Ticket #21169: next-to-each.patch
| File next-to-each.patch, 2.4 KB (added by devesine, 12 months ago) |
|---|
-
wp-includes/plugin.php
163 163 if ( empty($args) ) 164 164 $args = func_get_args(); 165 165 166 do{167 foreach( (array) current($wp_filter[$tag])as $the_ )166 while ( $next = each($wp_filter[$tag]) ) { 167 foreach( (array) $next['value'] as $the_ ) 168 168 if ( !is_null($the_['function']) ){ 169 169 $args[1] = $value; 170 170 $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); 171 171 } 172 172 173 } while ( next($wp_filter[$tag]) !== false );173 } 174 174 175 175 array_pop( $wp_current_filter ); 176 176 … … 221 221 222 222 reset( $wp_filter[ $tag ] ); 223 223 224 do{225 foreach( (array) current($wp_filter[$tag])as $the_ )224 while ( $next = each($wp_filter[$tag]) ) { 225 foreach( (array) $next['value'] as $the_ ) 226 226 if ( !is_null($the_['function']) ) 227 227 $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 228 228 229 } while ( next($wp_filter[$tag]) !== false );229 } 230 230 231 231 array_pop( $wp_current_filter ); 232 232 … … 397 397 398 398 reset( $wp_filter[ $tag ] ); 399 399 400 do{401 foreach ( (array) current($wp_filter[$tag])as $the_ )400 while ( $next = each($wp_filter[$tag]) ) { 401 foreach( (array) $next['value'] as $the_ ) 402 402 if ( !is_null($the_['function']) ) 403 403 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 404 404 405 } while ( next($wp_filter[$tag]) !== false );405 } 406 406 407 407 array_pop($wp_current_filter); 408 408 } … … 478 478 479 479 reset( $wp_filter[ $tag ] ); 480 480 481 do{482 foreach( (array) current($wp_filter[$tag])as $the_ )481 while ( $next = each($wp_filter[$tag]) ) { 482 foreach( (array) $next['value'] as $the_ ) 483 483 if ( !is_null($the_['function']) ) 484 484 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 485 485 486 } while ( next($wp_filter[$tag]) !== false );486 } 487 487 488 488 array_pop($wp_current_filter); 489 489 } … … 708 708 global $wp_filter; 709 709 710 710 reset( $wp_filter['all'] ); 711 do{712 foreach( (array) current($wp_filter['all'])as $the_ )711 while ( $next = each($wp_filter['all']) ) { 712 foreach( (array) $next['value'] as $the_ ) 713 713 if ( !is_null($the_['function']) ) 714 714 call_user_func_array($the_['function'], $args); 715 715 716 } while ( next($wp_filter['all']) !== false );716 } 717 717 } 718 718 719 719 /**