WPProfiler\Core\Hook::__construct |
( |
|
$hook_name, |
|
|
Function_ |
$collector |
|
) |
| |
Hook constructor.
- Parameters
-
\WP_Hook | $hook | |
string | $hook_name | |
\WPProfiler\Core\Profiler | $profiler | |
\WPProfiler\Core\Collectors\Function_ | $collector | |
WPProfiler\Core\Hook::add_filter |
( |
|
$tag, |
|
|
|
$function_to_add, |
|
|
|
$priority, |
|
|
|
$accepted_args |
|
) |
| |
Hooks a function or method to a specific filter action.
- Parameters
-
string | $tag | The name of the filter to hook the $function_to_add callback to. |
callable | $function_to_add | The callback to be run when the filter is applied. |
int | $priority | The order in which the functions associated with a particular action are executed. 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. |
int | $accepted_args | The number of arguments the function accepts. |
WPProfiler\Core\Hook::apply_filters |
( |
|
$value, |
|
|
|
$args |
|
) |
| |
Calls the callback functions that have been added to a filter hook.
- Parameters
-
mixed | $value | The value to filter. |
array | $args | Additional parameters to pass to the callback functions. This array is expected to include $value at index 0. |
- Returns
- mixed The filtered value after all hooked functions are applied to it.
WPProfiler\Core\Hook::current |
( |
| ) |
|
WPProfiler\Core\Hook::current_priority |
( |
| ) |
|
Return the current priority level of the currently running iteration of the hook.
- Returns
- int|false If the hook is running, return the current priority level. If it isn't running, return false.
WPProfiler\Core\Hook::do_action |
( |
|
$args | ) |
|
Calls the callback functions that have been added to an action hook.
- Parameters
-
array | $args | Parameters to pass to the callback functions. |
WPProfiler\Core\Hook::do_all_hook |
( |
& |
$args | ) |
|
Processes the functions hooked into the 'all' hook.
- Parameters
-
array | $args | Arguments to pass to the hook callbacks. Passed by reference. |
WPProfiler\Core\Hook::has_filter |
( |
|
$tag = '' , |
|
|
|
$function_to_check = false |
|
) |
| |
Checks if a specific action has been registered for this hook.
- Parameters
-
string | $tag | Optional. The name of the filter hook. Default empty. |
callable | bool | $function_to_check | Optional. The callback to check for. Default false. |
- Returns
- bool|int The priority of that hook is returned, or false if the function is not attached.
WPProfiler\Core\Hook::has_filters |
( |
| ) |
|
Checks if any callbacks have been registered for this hook.
- Returns
- bool True if callbacks have been registered for the current hook, otherwise false.
WPProfiler\Core\Hook::key |
( |
| ) |
|
WPProfiler\Core\Hook::next |
( |
| ) |
|
WPProfiler\Core\Hook::offsetExists |
( |
|
$offset | ) |
|
WPProfiler\Core\Hook::offsetGet |
( |
|
$offset | ) |
|
WPProfiler\Core\Hook::offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
WPProfiler\Core\Hook::offsetUnset |
( |
|
$offset | ) |
|
WPProfiler\Core\Hook::remove_all_filters |
( |
|
$priority = false | ) |
|
Removes all callbacks from the current filter.
- Parameters
-
int | bool | $priority | Optional. The priority number to remove. Default false. |
WPProfiler\Core\Hook::remove_filter |
( |
|
$tag, |
|
|
|
$function_to_remove, |
|
|
|
$priority |
|
) |
| |
Unhooks a function or method from a specific filter action.
- Parameters
-
string | $tag | The filter hook to which the function to be removed is hooked. |
callable | $function_to_remove | The callback to be removed from running when the filter is applied. |
int | $priority | The exact priority used when adding the original filter callback. |
- Returns
- bool Whether the callback existed before it was removed.
WPProfiler\Core\Hook::rewind |
( |
| ) |
|
WPProfiler\Core\Hook::valid |
( |
| ) |
|
Checks if current position is valid.
boolean
WPProfiler\Core\Hook::$callbacks = array() |
The documentation for this class was generated from the following file: