wppaste
WordPress

do_action_ref_array( string $hook_name, array $args )

Since
2.1.0
Source
wp-includes/plugin.php:537
Calls the callback functions that have been added to an action hook, specifying arguments in an array.

Parameters

$hook_namestring
The name of the action to be executed.
$argsarray
The arguments supplied to the functions hooked to $hook_name.

Uses · 1

Used by · 32

Show all 32

Source

function do_action_ref_array( $hook_name, $args ) {	global $wp_filter, $wp_actions, $wp_current_filter; 	if ( ! isset( $wp_actions[ $hook_name ] ) ) {		$wp_actions[ $hook_name ] = 1;	} else {		++$wp_actions[ $hook_name ];	} 	// Do 'all' actions first.	if ( isset( $wp_filter['all'] ) ) {		$wp_current_filter[] = $hook_name;		$all_args            = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection		_wp_call_all_hook( $all_args );	} 	if ( ! isset( $wp_filter[ $hook_name ] ) ) {		if ( isset( $wp_filter['all'] ) ) {			array_pop( $wp_current_filter );		} 		return;	} 	if ( ! isset( $wp_filter['all'] ) ) {		$wp_current_filter[] = $hook_name;	} 	$wp_filter[ $hook_name ]->do_action( $args ); 	array_pop( $wp_current_filter );}

History

Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/plugin.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.