WordPress.org

Make WordPress Core

Ticket #4223: 4223.diff

File 4223.diff, 1.2 KB (added by mdawaffe, 8 years ago)
  • wp-includes/plugin.php

     
    9797 * @return boolean Whether the function is removed. 
    9898 */ 
    9999function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 
    100         global $wp_filter, $merged_filters; 
     100        $function_to_remove = serialize($function_to_remove); 
    101101 
    102         unset($GLOBALS['wp_filter'][$tag][$priority][serialize($function_to_remove)]); 
    103         unset( $merged_filters[ $tag ] ); 
     102        $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); 
    104103 
    105         return true; 
     104        unset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); 
     105        unset($GLOBALS['merged_filters'][$tag]); 
     106 
     107        return $r; 
    106108} 
    107109 
    108110/** 
     
    216218 * @return boolean Whether the function is removed. 
    217219 */ 
    218220function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 
    219         remove_filter($tag, $function_to_remove, $priority, $accepted_args); 
     221        return remove_filter($tag, $function_to_remove, $priority, $accepted_args); 
    220222} 
    221223 
    222224// 
     
    274276        add_action('deactivate_' . $file, $function); 
    275277} 
    276278 
    277 ?> 
    278  No newline at end of file 
     279?>