Ticket #21169: next-to-each-22075.patch
File next-to-each-22075.patch, 2.4 KB (added by , 9 years ago) |
---|
-
wp-includes/plugin.php
166 166 if ( empty($args) ) 167 167 $args = func_get_args(); 168 168 169 do{170 foreach( (array) current($wp_filter[$tag])as $the_ )169 while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 170 foreach( $next['value'] as $the_ ) 171 171 if ( !is_null($the_['function']) ){ 172 172 $args[1] = $value; 173 173 $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); 174 174 } 175 } 175 176 176 } while ( next($wp_filter[$tag]) !== false );177 178 177 array_pop( $wp_current_filter ); 179 178 180 179 return $value; … … 224 223 225 224 reset( $wp_filter[ $tag ] ); 226 225 227 do{228 foreach( (array) current($wp_filter[$tag])as $the_ )226 while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 227 foreach( $next['value'] as $the_ ) 229 228 if ( !is_null($the_['function']) ) 230 229 $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 230 } 231 231 232 } while ( next($wp_filter[$tag]) !== false );233 234 232 array_pop( $wp_current_filter ); 235 233 236 234 return $args[0]; … … 400 398 401 399 reset( $wp_filter[ $tag ] ); 402 400 403 do{404 foreach ( (array) current($wp_filter[$tag])as $the_ )401 while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 402 foreach( $next['value'] as $the_ ) 405 403 if ( !is_null($the_['function']) ) 406 404 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 405 } 407 406 408 } while ( next($wp_filter[$tag]) !== false );409 410 407 array_pop($wp_current_filter); 411 408 } 412 409 … … 481 478 482 479 reset( $wp_filter[ $tag ] ); 483 480 484 do{485 foreach( (array) current($wp_filter[$tag])as $the_ )481 while ( ( $next = each($wp_filter[$tag]) ) !== false ) { 482 foreach( $next['value'] as $the_ ) 486 483 if ( !is_null($the_['function']) ) 487 484 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 485 } 488 486 489 } while ( next($wp_filter[$tag]) !== false );490 491 487 array_pop($wp_current_filter); 492 488 } 493 489 … … 713 709 global $wp_filter; 714 710 715 711 reset( $wp_filter['all'] ); 716 do{717 foreach( (array) current($wp_filter['all'])as $the_ )712 while ( ( $next = each($wp_filter['all']) ) !== false ) { 713 foreach( $next['value'] as $the_ ) 718 714 if ( !is_null($the_['function']) ) 719 715 call_user_func_array($the_['function'], $args); 720 721 } while ( next($wp_filter['all']) !== false ); 716 } 722 717 } 723 718 724 719 /**