[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-hook.php (summary)

Plugin API: WP_Hook class

File Size: 510 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 20 functions

  add_filter()
  resort_active_iterations()
  remove_filter()
  has_filter()
  has_filters()
  remove_all_filters()
  apply_filters()
  do_action()
  do_all_hook()
  current_priority()
  build_preinitialized_hooks()
  offsetExists()
  offsetGet()
  offsetSet()
  offsetUnset()
  current()
  next()
  key()
  valid()
  rewind()

Functions
Functions that are not part of a class:

add_filter( $tag, $function_to_add, $priority, $accepted_args )   X-Ref
Hooks a function or method to a specific filter action.

param: string   $tag             The name of the filter to hook the $function_to_add callback to.
param: callable $function_to_add The callback to be run when the filter is applied.
param: int      $priority        The order in which the functions associated with a
param: int      $accepted_args   The number of arguments the function accepts.
since: 4.7.0

resort_active_iterations( $new_priority = false, $priority_existed = false )   X-Ref
Handles reseting callback priority keys mid-iteration.

param: bool|int $new_priority     Optional. The priority of the new filter being added. Default false,
param: bool     $priority_existed Optional. Flag for whether the priority already existed before the new
since: 4.7.0

remove_filter( $tag, $function_to_remove, $priority )   X-Ref
Unhooks a function or method from a specific filter action.

param: string   $tag                The filter hook to which the function to be removed is hooked. Used
param: callable $function_to_remove The callback to be removed from running when the filter is applied.
param: int      $priority           The exact priority used when adding the original filter callback.
return: bool Whether the callback existed before it was removed.
since: 4.7.0

has_filter( $tag = '', $function_to_check = false )   X-Ref
Checks if a specific action has been registered for this hook.

param: string        $tag               Optional. The name of the filter hook. Used for building
param: callable|bool $function_to_check Optional. The callback to check for. Default false.
return: bool|int The priority of that hook is returned, or false if the function is not attached.
since: 4.7.0

has_filters()   X-Ref
Checks if any callbacks have been registered for this hook.

return: bool True if callbacks have been registered for the current hook, otherwise false.
since: 4.7.0

remove_all_filters( $priority = false )   X-Ref
Removes all callbacks from the current filter.

param: int|bool $priority Optional. The priority number to remove. Default false.
since: 4.7.0

apply_filters( $value, $args )   X-Ref
Calls the callback functions that have been added to a filter hook.

param: mixed $value The value to filter.
param: array $args  Additional parameters to pass to the callback functions.
return: mixed The filtered value after all hooked functions are applied to it.
since: 4.7.0

do_action( $args )   X-Ref
Calls the callback functions that have been added to an action hook.

param: array $args Parameters to pass to the callback functions.
since: 4.7.0

do_all_hook( &$args )   X-Ref
Processes the functions hooked into the 'all' hook.

param: array $args Arguments to pass to the hook callbacks. Passed by reference.
since: 4.7.0

current_priority()   X-Ref
Return the current priority level of the currently running iteration of the hook.

return: int|false If the hook is running, return the current priority level. If it isn't running, return false.
since: 4.7.0

build_preinitialized_hooks( $filters )   X-Ref
Normalizes filters set up before WordPress has initialized to WP_Hook objects.

param: array $filters Filters to normalize.
return: WP_Hook[] Array of normalized filters.
since: 4.7.0

offsetExists( $offset )   X-Ref
Determines whether an offset value exists.

param: mixed $offset An offset to check for.
return: bool True if the offset exists, false otherwise.
since: 4.7.0

offsetGet( $offset )   X-Ref
Retrieves a value at a specified offset.

param: mixed $offset The offset to retrieve.
return: mixed If set, the value at the specified offset, null otherwise.
since: 4.7.0

offsetSet( $offset, $value )   X-Ref
Sets a value at a specified offset.

param: mixed $offset The offset to assign the value to.
param: mixed $value The value to set.
since: 4.7.0

offsetUnset( $offset )   X-Ref
Unsets a specified offset.

param: mixed $offset The offset to unset.
since: 4.7.0

current()   X-Ref
Returns the current element.

return: array Of callbacks at current priority.
since: 4.7.0

next()   X-Ref
Moves forward to the next element.

return: array Of callbacks at next priority.
since: 4.7.0

key()   X-Ref
Returns the key of the current element.

return: mixed Returns current priority on success, or NULL on failure
since: 4.7.0

valid()   X-Ref
Checks if current position is valid.

return: boolean
since: 4.7.0

rewind()   X-Ref
Rewinds the Iterator to the first element.

since: 4.7.0



Generated: Mon Jul 22 01:00:03 2019 Cross-referenced by PHPXref 0.7.1