Revert [21287] until #21169 goes through. see #21321.

git-svn-id: http://core.svn.wordpress.org/trunk@21299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-07-21 20:24:21 +00:00
parent 68c0beb079
commit a530304b68
1 changed files with 22 additions and 18 deletions

View File

@ -167,10 +167,12 @@ function apply_filters($tag, $value) {
$args = func_get_args(); $args = func_get_args();
do { do {
foreach( (array) current($wp_filter[$tag]) as $the_ ) { foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) ){
$args[1] = $value; $args[1] = $value;
$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
} }
} while ( next($wp_filter[$tag]) !== false ); } while ( next($wp_filter[$tag]) !== false );
array_pop( $wp_current_filter ); array_pop( $wp_current_filter );
@ -223,9 +225,10 @@ function apply_filters_ref_array($tag, $args) {
reset( $wp_filter[ $tag ] ); reset( $wp_filter[ $tag ] );
do { do {
foreach( (array) current($wp_filter[$tag]) as $the_ ) { foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) )
$args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
}
} while ( next($wp_filter[$tag]) !== false ); } while ( next($wp_filter[$tag]) !== false );
array_pop( $wp_current_filter ); array_pop( $wp_current_filter );
@ -263,8 +266,6 @@ function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
unset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); unset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);
if ( empty($GLOBALS['wp_filter'][$tag][$priority]) ) if ( empty($GLOBALS['wp_filter'][$tag][$priority]) )
unset($GLOBALS['wp_filter'][$tag][$priority]); unset($GLOBALS['wp_filter'][$tag][$priority]);
if ( empty( $GLOBALS['wp_filter'][ $tag ] ) )
unset( $GLOBALS['wp_filter'][ $tag ] );
unset($GLOBALS['merged_filters'][$tag]); unset($GLOBALS['merged_filters'][$tag]);
} }
@ -400,9 +401,10 @@ function do_action($tag, $arg = '') {
reset( $wp_filter[ $tag ] ); reset( $wp_filter[ $tag ] );
do { do {
foreach ( (array) current($wp_filter[$tag]) as $the_ ) { foreach ( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) )
call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
}
} while ( next($wp_filter[$tag]) !== false ); } while ( next($wp_filter[$tag]) !== false );
array_pop($wp_current_filter); array_pop($wp_current_filter);
@ -480,9 +482,10 @@ function do_action_ref_array($tag, $args) {
reset( $wp_filter[ $tag ] ); reset( $wp_filter[ $tag ] );
do { do {
foreach( (array) current($wp_filter[$tag]) as $the_ ) { foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) )
call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
}
} while ( next($wp_filter[$tag]) !== false ); } while ( next($wp_filter[$tag]) !== false );
array_pop($wp_current_filter); array_pop($wp_current_filter);
@ -711,9 +714,10 @@ function _wp_call_all_hook($args) {
reset( $wp_filter['all'] ); reset( $wp_filter['all'] );
do { do {
foreach( (array) current($wp_filter['all']) as $the_ ) { foreach( (array) current($wp_filter['all']) as $the_ )
if ( !is_null($the_['function']) )
call_user_func_array($the_['function'], $args); call_user_func_array($the_['function'], $args);
}
} while ( next($wp_filter['all']) !== false ); } while ( next($wp_filter['all']) !== false );
} }