Ticket #26239: 26239.patch
File 26239.patch, 3.1 KB (added by , 11 years ago) |
---|
-
wp-includes/plugin.php
187 187 $merged_filters[ $tag ] = true; 188 188 } 189 189 190 reset( $wp_filter[ $tag ] ); 190 // Localize the filters global for iteration 191 $the_filters = $wp_filter[ $tag ]; 192 reset( $the_filters ); 191 193 192 194 if ( empty($args) ) 193 195 $args = func_get_args(); 194 196 195 197 do { 196 foreach( (array) current( $wp_filter[$tag]) as $the_ )198 foreach( (array) current( $the_filters ) as $the_ ) 197 199 if ( !is_null($the_['function']) ){ 198 200 $args[1] = $value; 199 201 $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); 200 202 } 201 203 202 } while ( next( $wp_filter[$tag]) !== false );204 } while ( next( $the_filters ) !== false ); 203 205 204 206 array_pop( $wp_current_filter ); 205 207 … … 248 250 $merged_filters[ $tag ] = true; 249 251 } 250 252 251 reset( $wp_filter[ $tag ] ); 253 // Localize the filters global for iteration 254 $the_filters = $wp_filter[ $tag ]; 255 reset( $the_filters ); 252 256 253 257 do { 254 foreach( (array) current( $wp_filter[$tag]) as $the_ )258 foreach( (array) current( $the_filters ) as $the_ ) 255 259 if ( !is_null($the_['function']) ) 256 260 $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 257 261 258 } while ( next( $wp_filter[$tag]) !== false );262 } while ( next( $the_filters ) !== false ); 259 263 260 264 array_pop( $wp_current_filter ); 261 265 … … 421 425 $merged_filters[ $tag ] = true; 422 426 } 423 427 424 reset( $wp_filter[ $tag ] ); 428 // Localize the filters global for iteration 429 $the_filters = $wp_filter[ $tag ]; 430 reset( $the_filters ); 425 431 426 432 do { 427 foreach ( (array) current( $wp_filter[$tag]) as $the_ )433 foreach ( (array) current( $the_filters ) as $the_ ) 428 434 if ( !is_null($the_['function']) ) 429 435 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 430 436 431 } while ( next( $wp_filter[$tag]) !== false );437 } while ( next( $the_filters ) !== false ); 432 438 433 439 array_pop($wp_current_filter); 434 440 } … … 499 505 $merged_filters[ $tag ] = true; 500 506 } 501 507 502 reset( $wp_filter[ $tag ] ); 508 // Localize the filters global for iteration 509 $the_filters = $wp_filter[ $tag ]; 510 reset( $the_filters ); 503 511 504 512 do { 505 foreach( (array) current( $wp_filter[$tag]) as $the_ )513 foreach( (array) current( $the_filters ) as $the_ ) 506 514 if ( !is_null($the_['function']) ) 507 515 call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); 508 516 509 } while ( next( $wp_filter[$tag]) !== false );517 } while ( next( $the_filters ) !== false ); 510 518 511 519 array_pop($wp_current_filter); 512 520 } … … 732 740 function _wp_call_all_hook($args) { 733 741 global $wp_filter; 734 742 735 reset( $wp_filter['all'] ); 743 // Localize the filters global for iteration 744 $the_filters = $wp_filter['all']; 745 reset( $the_filters ); 736 746 do { 737 foreach( (array) current( $wp_filter['all']) as $the_ )747 foreach( (array) current( $the_filters ) as $the_ ) 738 748 if ( !is_null($the_['function']) ) 739 749 call_user_func_array($the_['function'], $args); 740 750 741 } while ( next( $wp_filter['all']) !== false );751 } while ( next( $the_filters ) !== false ); 742 752 } 743 753 744 754 /**