Make WordPress Core

Ticket #7216: remove_filter.diff

File remove_filter.diff, 720 bytes (added by filosofo, 17 years ago)
  • wp-includes/plugin.php

     
    192192 * @return boolean Whether the function existed before it was removed.
    193193 */
    194194function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
     195        if ( 'all' == $function_to_remove && isset($GLOBALS['wp_filter'][$tag]) ) {
     196                unset($GLOBALS['wp_filter'][$tag]);
     197                unset($GLOBALS['merged_filters'][$tag]);
     198                return true;
     199        }
     200
    195201        $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);
    196202
    197203        $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);