Changeset 5936 for trunk/wp-includes/plugin.php
- Timestamp:
- 08/24/2007 02:18:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r5924 r5936 20 20 21 21 // So the format is wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]'] 22 $wp_filter[$tag][$priority][serialize($function_to_add)] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 22 $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority); 23 $wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 24 //$wp_filter[$tag][$priority][serialize($function_to_add)] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 23 25 unset( $merged_filters[ $tag ] ); 24 26 return true; … … 98 100 */ 99 101 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 100 $function_to_remove = serialize($function_to_remove);102 $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority); 101 103 102 104 $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); … … 282 284 } 283 285 286 function _wp_filter_build_unique_id($tag, $function, $priority = 10) 287 { 288 global $wp_filter; 289 290 // If function then just skip all of the tests and not overwrite the following. 291 // Static Calling 292 if( is_string($function) ) 293 return $function; 294 // Object Class Calling 295 else if(is_object($function[0]) ) 296 { 297 $obj_idx = get_class($function[0]).$function[1]; 298 if( is_null($function[0]->wp_filter_id) ) { 299 $count = count((array)$wp_filter[$tag][$priority]); 300 $function[0]->wp_filter_id = $count; 301 $obj_idx .= $count; 302 unset($count); 303 } else 304 $obj_idx .= $function[0]->wp_filter_id; 305 return $obj_idx; 306 } 307 else if( is_string($function[0]) ) 308 return $function[0].$function[1]; 309 } 310 284 311 ?>
Note: See TracChangeset
for help on using the changeset viewer.