WordPress.org

Make WordPress Core

Ticket #21172: add-at-9-after-21169.patch

File add-at-9-after-21169.patch, 2.0 KB (added by devesine, 12 months ago)
  • wp-includes/plugin.

    old new  
    163163        if ( empty($args) ) 
    164164                $args = func_get_args(); 
    165165 
     166        $pri = null; 
    166167        while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 
     168                if ( is_null($pri) ) 
     169                        $pri = $next['key']; 
     170                if ( $pri > $next['key'] ) 
     171                        continue; 
    167172                foreach( (array) $next['value'] as $the_ ) 
    168173                        if ( !is_null($the_['function']) ){ 
    169174                                $args[1] = $value; 
     
    221226 
    222227        reset( $wp_filter[ $tag ] ); 
    223228 
     229        $pri = null; 
    224230        while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 
     231                if ( is_null($pri) ) 
     232                        $pri = $next['key']; 
     233                if ( $pri > $next['key'] ) 
     234                        continue; 
    225235                foreach( (array) $next['value'] as $the_ ) 
    226236                        if ( !is_null($the_['function']) ) 
    227237                                $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 
     
    397407 
    398408        reset( $wp_filter[ $tag ] ); 
    399409 
     410        $pri = null; 
    400411        while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 
     412                if ( is_null($pri) ) 
     413                        $pri = $next['key']; 
     414                if ( $pri > $next['key'] ) 
     415                        continue; 
    401416                foreach( (array) $next['value'] as $the_ ) 
    402417                        if ( !is_null($the_['function']) ) 
    403418                                call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 
     
    478493 
    479494        reset( $wp_filter[ $tag ] ); 
    480495 
     496        $pri = null; 
    481497        while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 
     498                if ( is_null($pri) ) 
     499                        $pri = $next['key']; 
     500                if ( $pri > $next['key'] ) 
     501                        continue; 
    482502                foreach( (array) $next['value'] as $the_ ) 
    483503                        if ( !is_null($the_['function']) ) 
    484504                                call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 
     
    708728        global $wp_filter; 
    709729 
    710730        reset( $wp_filter['all'] ); 
     731        $pri = $null; 
    711732        while ( ( $next = each($wp_filter['all']) ) !== false ) { 
     733                if ( is_null($pri) ) 
     734                        $pri = $next['key']; 
     735                if ( $pri > $next['key'] ) 
     736                        continue; 
    712737                foreach( (array) $next['value'] as $the_ ) 
    713738                        if ( !is_null($the_['function']) ) 
    714739                                call_user_func_array($the_['function'], $args);