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

@ -296,18 +296,20 @@ function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
* @param int $priority The priority number to remove.
* @return bool True when finished.
*/
function remove_all_filters($tag, $priority = false) {
function remove_all_filters( $tag, $priority = false ) {
global $wp_filter, $merged_filters;
if( isset($wp_filter[$tag]) ) {
if( false !== $priority && isset($wp_filter[$tag][$priority]) )
unset($wp_filter[$tag][$priority]);
else
unset($wp_filter[$tag]);
if ( isset( $wp_filter[ $tag ]) ) {
if ( false !== $priority && isset( $wp_filter[ $tag ][ $priority ] ) ) {
$wp_filter[ $tag ][ $priority ] = array();
} else {
$wp_filter[ $tag ] = array();
}
}
if( isset($merged_filters[$tag]) )
unset($merged_filters[$tag]);
if ( isset( $merged_filters[ $tag ] ) ) {
unset( $merged_filters[ $tag ] );
}
return true;
}