do_action_ref_array( string $tag, array $args )

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

Description Description

See also See also

  • do_action(): This function is identical, but the arguments passed to the functions hooked to $tag< are supplied using an array.

Top ↑

Parameters Parameters


(string) (Required) The name of the action to be executed.


(array) (Required) The arguments supplied to the functions hooked to $tag.

Top ↑

Source Source

File: wp-includes/plugin.php

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 );


Top ↑

Changelog Changelog

Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.