_wp_call_all_hook

Call the 'all' hook, which will process the functions hooked into it.

Description

_wp_call_all_hook( (array) $args ); 

The all hook passes all of the arguments or parameters that were used for the hook, which this function was called for.

This function is used internally for apply_filters(), do_action(), and do_action_ref_array() and is not meant to be used from outside those functions. This function does not check for the existence of the all hook, so it will fail unless the all hook exists prior to this function call.

Parameters (1)

0. $args (array)
The collected parameters from the hook that was called.

Usage

  1. if ( !function_exists( '_wp_call_all_hook' ) ) { 
  2. require_once ABSPATH . WPINC . '/plugin.php'; 
  3.  
  4. // The collected parameters from the hook that was called. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _wp_call_all_hook($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/plugin.php  
  1. function _wp_call_all_hook($args) { 
  2. global $wp_filter; 
  3.  
  4. reset( $wp_filter['all'] ); 
  5. do { 
  6. foreach ( (array) current($wp_filter['all']) as $the_ ) 
  7. if ( !is_null($the_['function']) ) 
  8. call_user_func_array($the_['function'], $args); 
  9.  
  10. } while ( next($wp_filter['all']) !== false );