$filters
$filters : array
$filters holds list of hooks
Hooks
addFilter(string $tag, callback $function_to_add, integer $priority = 10, integer $accepted_args = 1) : boolean
addFilter Hooks a function or method to a specific filter action.
string | $tag | The name of the filter to hook the $function_to_add to. |
callback | $function_to_add | The name of the function to be called when the filter is applied. |
integer | $priority | optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. |
integer | $accepted_args | optional. The number of arguments the function accept (default 1). |
true
removeFilter(string $tag, callback $function_to_remove, integer $priority = 10) : boolean
removeFilter Removes a function from a specified filter hook.
string | $tag | The filter hook to which the function to be removed is hooked. |
callback | $function_to_remove | The name of the function which should be removed. |
integer | $priority | optional. The priority of the function (default: 10). |
Whether the function existed before it was removed.
hasFilter(string $tag, callback $function_to_check = false) : mixed
hasFilter Check if any filter has been registered for a hook.
string | $tag | The name of the filter hook. |
callback | $function_to_check | optional. |
If $function_to_check is omitted, returns boolean for whether the hook has anything registered. When checking a specific function, the priority of that hook is returned, or false if the function is not attached. When using the $function_to_check argument, this function may return a non-boolean value that evaluates to false (e.g.) 0, so use the === operator for testing the return value.
applyFilters(string $tag, mixed $value) : mixed
applyFilters Call the functions added to a filter hook.
string | $tag | The name of the filter hook. |
mixed | $value | The value on which the filters hooked to $tag are applied on. |
The filtered value after all hooked functions are applied to it.
applyFiltersRefArray(string $tag, array $args) : mixed
applyFiltersRefArray Execute functions hooked on a specific filter hook, specifying arguments in an array.
string | $tag | The name of the filter hook. |
array | $args | The arguments supplied to the functions hooked to $tag |
The filtered value after all hooked functions are applied to it.
addAction(string $tag, callback $function_to_add, integer $priority = 10, integer $accepted_args = 1)
addAction Hooks a function on to a specific action.
string | $tag | The name of the action to which the $function_to_add is hooked. |
callback | $function_to_add | The name of the function you wish to be called. |
integer | $priority | optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. |
integer | $accepted_args | optional. The number of arguments the function accept (default 1). |
hasAction(string $tag, callback $function_to_check = false) : mixed
hasAction Check if any action has been registered for a hook.
string | $tag | The name of the action hook. |
callback | $function_to_check | optional. |
If $function_to_check is omitted, returns boolean for whether the hook has anything registered. When checking a specific function, the priority of that hook is returned, or false if the function is not attached. When using the $function_to_check argument, this function may return a non-boolean value that evaluates to false (e.g.) 0, so use the === operator for testing the return value.
removeAction(string $tag, callback $function_to_remove, integer $priority = 10) : boolean
removeAction Removes a function from a specified action hook.
string | $tag | The action hook to which the function to be removed is hooked. |
callback | $function_to_remove | The name of the function which should be removed. |
integer | $priority | optional The priority of the function (default: 10). |
Whether the function is removed.
doActionRefArray(string $tag, array $args) : null
doActionRefArray Execute functions hooked on a specific action hook, specifying arguments in an array.
string | $tag | The name of the action to be executed. |
array | $args | The arguments supplied to the functions hooked to $tag |
Will return null if $tag does not exist in $filter array
doingFilter(null|string $filter = null) : boolean
Retrieve the name of a filter currently being processed.
The function currentFilter() only returns the most recent filter or action being executed. didAction() returns true once the action is initially processed. This function allows detection for any filter currently being executed (despite not being the most recent filter to fire, in the case of hooks called from hook callbacks) to be verified.
null|string | $filter | Optional. Filter to check. Defaults to null, which checks if any filter is currently being run. |
Whether the filter is currently in the stack
doingAction(string|null $action = null) : boolean
Retrieve the name of an action currently being processed.
string|null | $action | Optional. Action to check. Defaults to null, which checks if any action is currently being run. |
Whether the action is currently in the stack.
_filterBuildUniqueID(string $tag, callback $function, integer|boolean $priority) : string|boolean
_filterBuildUniqueID Build Unique ID for storage and retrieval.
string | $tag | Used in counting how many hooks were applied |
callback | $function | Used for creating unique id |
integer|boolean | $priority | Used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise. |
Unique ID for usage as array key or false if $priority === false and $function is an object reference, and it does not already have a unique id.