Skip to main content
Server Proxied to ug-core. See the Hooks guide and the Hooks reference.

Register

UgHookName
required
A value of UgCore.Enums.Hooks, such as 'Accounts:BeforeRemove'.
fun(payload): boolean | table | nil
required
Return false to cancel. Return a table to replace the payload for the next handlers. Return nothing to let it pass.
integer
Lower runs first. Defaults to 0.
integer
Pass to Unregister.
Hooks of a resource are removed when it stops. A failing handler is logged and skipped.

Unregister

Example

Your handler gets a copy of the payload. Return the changed table so ug-core sees your changes.