mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
Ensure that apply_filters_ref_array passes the result of the filter to the next filter. Fixes #12723 props scribue.
git-svn-id: http://svn.automattic.com/wordpress/trunk@13906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fb96ce358a
commit
c3a6bea231
@ -195,8 +195,6 @@ function apply_filters_ref_array($tag, $args) {
|
|||||||
|
|
||||||
$wp_current_filter[] = $tag;
|
$wp_current_filter[] = $tag;
|
||||||
|
|
||||||
$value = $args[0];
|
|
||||||
|
|
||||||
// Do 'all' actions first
|
// Do 'all' actions first
|
||||||
if ( isset($wp_filter['all']) ) {
|
if ( isset($wp_filter['all']) ) {
|
||||||
$all_args = func_get_args();
|
$all_args = func_get_args();
|
||||||
@ -205,7 +203,7 @@ function apply_filters_ref_array($tag, $args) {
|
|||||||
|
|
||||||
if ( !isset($wp_filter[$tag]) ) {
|
if ( !isset($wp_filter[$tag]) ) {
|
||||||
array_pop($wp_current_filter);
|
array_pop($wp_current_filter);
|
||||||
return $value;
|
return $args[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort
|
// Sort
|
||||||
@ -219,13 +217,13 @@ function apply_filters_ref_array($tag, $args) {
|
|||||||
do {
|
do {
|
||||||
foreach( (array) current($wp_filter[$tag]) as $the_ )
|
foreach( (array) current($wp_filter[$tag]) as $the_ )
|
||||||
if ( !is_null($the_['function']) )
|
if ( !is_null($the_['function']) )
|
||||||
$value = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
|
$args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
|
||||||
|
|
||||||
} while ( next($wp_filter[$tag]) !== false );
|
} while ( next($wp_filter[$tag]) !== false );
|
||||||
|
|
||||||
array_pop( $wp_current_filter );
|
array_pop( $wp_current_filter );
|
||||||
|
|
||||||
return $value;
|
return $args[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user