After [28883], `remove_filter()` should set `$GLOBALS['wp_filter'][ $tag ]` to `array()` when empty.
Props wonderboymusic, sphoid. Fixes #28142. Built from https://develop.svn.wordpress.org/trunk@28884 git-svn-id: http://core.svn.wordpress.org/trunk@28683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9275c87190
commit
0289b98648
|
@ -279,8 +279,12 @@ function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
|
||||||
|
|
||||||
if ( true === $r ) {
|
if ( true === $r ) {
|
||||||
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 ] ) ) {
|
||||||
|
$GLOBALS['wp_filter'][ $tag ] = array();
|
||||||
|
}
|
||||||
unset( $GLOBALS['merged_filters'][ $tag ] );
|
unset( $GLOBALS['merged_filters'][ $tag ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue