do_action_ref_array

The WordPress Core do action ref array function.

Description

do_action_ref_array(); 

Usage

  1. if ( !function_exists( 'do_action_ref_array' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/noop.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = do_action_ref_array(); 
  7.  

Defined (2)

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

/wp-admin/includes/noop.php  
  1. function do_action_ref_array() {} 
/wp-includes/plugin.php  
  1. function do_action_ref_array($tag, $args) { 
  2. global $wp_filter, $wp_actions, $wp_current_filter; 
  3.  
  4. if ( ! isset($wp_actions[$tag]) ) 
  5. $wp_actions[$tag] = 1; 
  6. else 
  7. ++$wp_actions[$tag]; 
  8.  
  9. // Do 'all' actions first 
  10. if ( isset($wp_filter['all']) ) { 
  11. $wp_current_filter[] = $tag; 
  12. $all_args = func_get_args(); 
  13. _wp_call_all_hook($all_args); 
  14.  
  15. if ( !isset($wp_filter[$tag]) ) { 
  16. if ( isset($wp_filter['all']) ) 
  17. array_pop($wp_current_filter); 
  18. return; 
  19.  
  20. if ( !isset($wp_filter['all']) ) 
  21. $wp_current_filter[] = $tag; 
  22.  
  23. $wp_filter[ $tag ]->do_action( $args ); 
  24.  
  25. array_pop($wp_current_filter);