$filter ) { // Filter should always be an array - array( $this, 'method' ), if not goto next if( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue; // If first value in array is not an object, it can't be a class if( ! is_object( $filter['function'][0] ) ) continue; // If class name does not match the class we're looking for, goto next if( get_class( $filter['function'][0] ) !== $class_name ) continue; // Yay we found our filter if( $filter['function'][1] === $method_name ) { // Now let's remove it from the array unset( $wp_filter[ $tag ][ $priority ][ $filter_id ] ); // and if it was the only filter in that priority, unset that priority if( empty($wp_filter[ $tag ][ $priority ]) ) unset($wp_filter[ $tag ][ $priority ]); // and if the only filter for that tag, set the tag to an empty array if( empty($wp_filter[ $tag ]) ) $wp_filter[ $tag ] = array(); // Remove this filter from merged_filters (specifies if filters have been sorted) unset($GLOBALS['merged_filters'][ $tag ]); return TRUE; } } return FALSE; }