Make WordPress Core

Ticket #9968: 9968.2.diff

File 9968.2.diff, 1.2 KB (added by Denis-de-Bernardy, 14 years ago)

the two reset calls probably aren't needed either

  • wp-includes/plugin.php

     
    154154                $merged_filters[ $tag ] = true;
    155155        }
    156156
    157         reset( $wp_filter[ $tag ] );
    158 
    159157        if ( empty($args) )
    160158                $args = func_get_args();
    161159
    162         do {
    163                 foreach( (array) current($wp_filter[$tag]) as $the_ )
     160        foreach ( $wp_filter[$tag] as $filters ) {
     161                foreach( (array) $filters as $the_ )
    164162                        if ( !is_null($the_['function']) ){
    165163                                $args[1] = $value;
    166164                                $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
    167165                        }
     166        }
    168167
    169         } while ( next($wp_filter[$tag]) !== false );
    170 
    171168        array_pop( $wp_current_filter );
    172169
    173170        return $value;
     
    331328                $merged_filters[ $tag ] = true;
    332329        }
    333330
    334         reset( $wp_filter[ $tag ] );
    335 
    336         do {
    337                 foreach ( (array) current($wp_filter[$tag]) as $the_ )
     331        foreach ( $wp_filter[$tag] as $filters ) {
     332                foreach ( (array) $filters as $the_ )
    338333                        if ( !is_null($the_['function']) )
    339334                                call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
    340335
    341         } while ( next($wp_filter[$tag]) !== false );
     336        }
    342337
    343338        array_pop($wp_current_filter);
    344339}