How to run your code before/after functions (PreHook/PostHook)
From ESOUI Wiki
There do exist some ZOs functions to "hook" into functions or eventhandlers like "OnMouseUp" of other controls/functions.
They are either Pre-Hooks (run before the original function and able to suppress the original code):
Or Post-Hooks (run after the original function):
Information about "secure":
If you isnert your code into e.g. the inventory and your code get's executed before the inventory is "securely" build,
it may raise error messages as the secure environment got tainted by your code.
That's why ZOs also added the SecurePostHook in order to apply your code after their code was run.
Please check this link for additional information: