Changeset 6014
- Timestamp:
- 09/03/2007 02:59:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-includes/plugin.php
r5928 r6014 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 $wp_filter[$tag][$priority][_wp_filter_build_unique_id($tag, $function_to_add, $priority)] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 23 23 unset( $merged_filters[ $tag ] ); 24 24 return true; … … 99 99 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 100 100 global $wp_filter, $merged_filters; 101 102 unset($GLOBALS['wp_filter'][$tag][$priority][ serialize($function_to_remove)]);101 102 unset($GLOBALS['wp_filter'][$tag][$priority][_wp_filter_build_unique_id($tag, $function_to_remove, $priority)]); 103 103 unset( $merged_filters[ $tag ] ); 104 104 … … 280 280 } 281 281 282 function _wp_filter_build_unique_id($tag, $function, $priority = 10) 283 { 284 global $wp_filter; 285 286 // If function then just skip all of the tests and not overwrite the following. 287 if( is_string($function) ) 288 return $function; 289 // Object Class Calling 290 else if(is_object($function[0]) ) 291 { 292 $obj_idx = get_class($function[0]).$function[1]; 293 if( is_null($function[0]->wp_filter_id) ) { 294 $count = count((array)$wp_filter[$tag][$priority]); 295 $function[0]->wp_filter_id = $count; 296 $obj_idx .= $count; 297 unset($count); 298 } else 299 $obj_idx .= $function[0]->wp_filter_id; 300 return $obj_idx; 301 } 302 // Static Calling 303 else if( is_string($function[0]) ) 304 return $function[0].$function[1]; 305 } 306 282 307 ?>
Note: See TracChangeset
for help on using the changeset viewer.