WordPress.org

Make WordPress Core

Ticket #9968: 9968.diff

File 9968.diff, 1.1 KB (added by Denis-de-Bernardy, 9 years ago)
  • wp-includes/plugin.php

     
    159159        if ( empty($args) )
    160160                $args = func_get_args();
    161161
    162         do {
    163                 foreach( (array) current($wp_filter[$tag]) as $the_ )
     162        foreach ( $wp_filter[$tag] as $filters ) {
     163                foreach( (array) $filters as $the_ )
    164164                        if ( !is_null($the_['function']) ){
    165165                                $args[1] = $value;
    166166                                $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
    167167                        }
    168168
    169         } while ( next($wp_filter[$tag]) !== false );
     169        }
    170170
    171171        array_pop( $wp_current_filter );
    172172
     
    333333
    334334        reset( $wp_filter[ $tag ] );
    335335
    336         do {
    337                 foreach ( (array) current($wp_filter[$tag]) as $the_ )
     336        foreach ( $wp_filter[$tag] as $filters ) {
     337                foreach ( (array) $filters as $the_ )
    338338                        if ( !is_null($the_['function']) )
    339339                                call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
    340340
    341         } while ( next($wp_filter[$tag]) !== false );
     341        }
    342342
    343343        array_pop($wp_current_filter);
    344344}