[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Plugin API: WP_Hook class

File Size: 511 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.

since: 4.7.0
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.

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

since: 4.7.0
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

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

return: bool Whether the callback existed before it was removed.
since: 4.7.0
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.

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

return: bool|int The priority of that hook is returned, or false if the function is not attached.
since: 4.7.0
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.

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.

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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: Wed Nov 13 01:00:03 2019 Cross-referenced by PHPXref 0.7.1