Make WordPress Core

Changeset 13906


Ignore:
Timestamp:
03/31/2010 09:39:18 PM (17 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/plugin.php

    r13827 r13906  
    196196        $wp_current_filter[] = $tag;
    197197
    198         $value = $args[0];
    199 
    200198        // Do 'all' actions first
    201199        if ( isset($wp_filter['all']) ) {
    … …  
    206204        if ( !isset($wp_filter[$tag]) ) {
    207205                array_pop($wp_current_filter);
    208                 return $value;
     206                return $args[0];
    209207        }
    210208
    … …  
    220218                foreach( (array) current($wp_filter[$tag]) as $the_ )
    221219                        if ( !is_null($the_['function']) )
    222                                 $value = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
     220                                $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
    223221
    224222        } while ( next($wp_filter[$tag]) !== false );
    … …  
    226224        array_pop( $wp_current_filter );
    227225
    228         return $value;
     226        return $args[0];
    229227}
    230228
Note: See TracChangeset for help on using the changeset viewer.