WordPress at a glance

do_action_ref_array() WP 1.0

Execute functions hooked on a specific action hook, specifying arguments in an array.

  • See: do_action() This function is identical, but the arguments passed to the
    functions hooked to $tag< are supplied using an array.
  • Global. Array. $wp_filter Stores all of the filters
  • Global. Array. $wp_actions Increments the amount of times action was triggered.
  • Global. Array. $wp_current_filter Stores the list of current filters with the current one last

No Hooks.


Nothing (null).


do_action_ref_array( $tag, $args );
$tag(string) (required)
The name of the action to be executed.
$args(array) (required)
The arguments supplied to the functions hooked to $tag.

Code of do action ref array: wp-includes/plugin.php VER 5.0.3

function do_action_ref_array($tag, $args) {
	global $wp_filter, $wp_actions, $wp_current_filter;

	if ( ! isset($wp_actions[$tag]) )
		$wp_actions[$tag] = 1;

	// Do 'all' actions first
	if ( isset($wp_filter['all']) ) {
		$wp_current_filter[] = $tag;
		$all_args = func_get_args();

	if ( !isset($wp_filter[$tag]) ) {
		if ( isset($wp_filter['all']) )

	if ( !isset($wp_filter['all']) )
		$wp_current_filter[] = $tag;

	$wp_filter[ $tag ]->do_action( $args );


Related Functions

From tag: Actions (hooks)

More from category: Hooks (actions, filters)

No comments
    Hello, !     Log In . Register