Ensure that apply_filters_ref_array passes the result of the filter to the next filter. Fixes #12723 props scribue.

git-svn-id: https://develop.svn.wordpress.org/trunk@13906 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2010-03-31 21:39:18 +00:00
parent 3ba87e11a2
commit ed9ee9a2da
1 changed files with 3 additions and 5 deletions

View File

@ -195,8 +195,6 @@ function apply_filters_ref_array($tag, $args) {
$wp_current_filter[] = $tag;
$value = $args[0];
// Do 'all' actions first
if ( isset($wp_filter['all']) ) {
$all_args = func_get_args();
@ -205,7 +203,7 @@ function apply_filters_ref_array($tag, $args) {
if ( !isset($wp_filter[$tag]) ) {
array_pop($wp_current_filter);
return $value;
return $args[0];
}
// Sort
@ -219,13 +217,13 @@ function apply_filters_ref_array($tag, $args) {
do {
foreach( (array) current($wp_filter[$tag]) as $the_ )
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 );
array_pop( $wp_current_filter );
return $value;
return $args[0];
}
/**