hook_manager_interface
interface hook_manager_interface
Contract for the Hook Manager.
Provides a WordPress-style system of "filters" and "actions".
Filters: Modify a value and return it. Actions: Execute side effects, no return value.
Methods
Register a new filter callback.
Apply all registered filters to a value.
Register a new action callback.
Execute all callbacks registered for a given action.
Check whether any callback is registered for the given action.
Clear all registered hooks. Essential for unit testing isolation.
Details
at line 38
static void
add_filter(string $tag, callable $function, int $priority = 10, int $args = 1)
Register a new filter callback.
at line 49
static mixed
apply_filters(string $tag, mixed $value, mixed ...$args)
Apply all registered filters to a value.
at line 59
static void
add_action(string $tag, callable $function, int $priority = 10, int $args = 1)
Register a new action callback.
at line 67
static void
do_action(string $tag, mixed ...$args)
Execute all callbacks registered for a given action.
at line 76
static bool
has_action(string $tag)
Check whether any callback is registered for the given action.
at line 81
static void
reset()
Clear all registered hooks. Essential for unit testing isolation.