WP Profiler
Public Member Functions | Public Attributes | List of all members
WPProfiler\Core\Hook Class Reference
Inheritance diagram for WPProfiler\Core\Hook:

Public Member Functions

 __construct ($hook_name, Function_ $collector)
 
 add_filter ($tag, $function_to_add, $priority, $accepted_args)
 
 remove_filter ($tag, $function_to_remove, $priority)
 
 has_filter ($tag= '', $function_to_check=false)
 
 has_filters ()
 
 remove_all_filters ($priority=false)
 
 do_action ($args)
 
 apply_filters ($value, $args)
 
 do_all_hook (&$args)
 
 current_priority ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 

Public Attributes

 $callbacks = array()
 

Constructor & Destructor Documentation

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

Member Function Documentation

WPProfiler\Core\Hook::add_filter (   $tag,
  $function_to_add,
  $priority,
  $accepted_args 
)

Hooks a function or method to a specific filter action.

Parameters
string$tagThe name of the filter to hook the $function_to_add callback to.
callable$function_to_addThe callback to be run when the filter is applied.
int$priorityThe 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_argsThe 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$valueThe value to filter.
array$argsAdditional 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 ( )

Returns the current element.

array Of callbacks at current priority.

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$argsParameters to pass to the callback functions.
WPProfiler\Core\Hook::do_all_hook ( $args)

Processes the functions hooked into the 'all' hook.

Parameters
array$argsArguments 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$tagOptional. The name of the filter hook. Default empty.
callable | bool$function_to_checkOptional. 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 ( )

Moves forward to the next element.

array Of callbacks at next priority.

WPProfiler\Core\Hook::offsetExists (   $offset)
WPProfiler\Core\Hook::offsetGet (   $offset)
WPProfiler\Core\Hook::offsetSet (   $offset,
  $value 
)
WPProfiler\Core\Hook::offsetUnset (   $offset)

Unsets a specified offset.

mixed $offset The offset to unset.

WPProfiler\Core\Hook::remove_all_filters (   $priority = false)

Removes all callbacks from the current filter.

Parameters
int | bool$priorityOptional. 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$tagThe filter hook to which the function to be removed is hooked.
callable$function_to_removeThe callback to be removed from running when the filter is applied.
int$priorityThe exact priority used when adding the original filter callback.
Returns
bool Whether the callback existed before it was removed.
WPProfiler\Core\Hook::rewind ( )

Rewinds the Iterator to the first element.

https://secure.php.net/manual/en/iterator.rewind.php

WPProfiler\Core\Hook::valid ( )

Checks if current position is valid.

boolean

Member Data Documentation

WPProfiler\Core\Hook::$callbacks = array()

The documentation for this class was generated from the following file: