wppaste
WordPress

apply_filters_ref_array( string $hook_name, array $args ): mixed

Since
3.0.0
Source
wp-includes/plugin.php:228
Calls the callback functions that have been added to a filter hook, specifying arguments in an array.

Parameters

$hook_namestring
The name of the filter hook.
$argsarray
The arguments supplied to the functions hooked to $hook_name.

Return

mixed
The filtered value after all hooked functions are applied to it.

Uses · 1

Used by · 12

Source

function apply_filters_ref_array( $hook_name, $args ) {	global $wp_filter, $wp_filters, $wp_current_filter; 	if ( ! isset( $wp_filters[ $hook_name ] ) ) {		$wp_filters[ $hook_name ] = 1;	} else {		++$wp_filters[ $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 $args[0];	} 	if ( ! isset( $wp_filter['all'] ) ) {		$wp_current_filter[] = $hook_name;	} 	$filtered = $wp_filter[ $hook_name ]->apply_filters( $args[0], $args ); 	array_pop( $wp_current_filter ); 	return $filtered;}

History

Introduced in 3.0.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.9.7 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.