remove_all_filters() should set to array(), not call unset().

Props nacin, c3mdigital.
Fixes #19306.

Built from https://develop.svn.wordpress.org/trunk@28883


git-svn-id: http://core.svn.wordpress.org/trunk@28682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-28 04:27:15 +00:00
parent 0e3c4450cb
commit 9275c87190

View File

@ -300,14 +300,16 @@ function remove_all_filters($tag, $priority = false) {
global $wp_filter, $merged_filters; global $wp_filter, $merged_filters;
if ( isset( $wp_filter[ $tag ]) ) { if ( isset( $wp_filter[ $tag ]) ) {
if( false !== $priority && isset($wp_filter[$tag][$priority]) ) if ( false !== $priority && isset( $wp_filter[ $tag ][ $priority ] ) ) {
unset($wp_filter[$tag][$priority]); $wp_filter[ $tag ][ $priority ] = array();
else } else {
unset($wp_filter[$tag]); $wp_filter[ $tag ] = array();
}
} }
if( isset($merged_filters[$tag]) ) if ( isset( $merged_filters[ $tag ] ) ) {
unset( $merged_filters[ $tag ] ); unset( $merged_filters[ $tag ] );
}
return true; return true;
} }