Changeset 5169 for trunk/wp-includes/plugin.php
- Timestamp:
- 04/02/2007 07:03:38 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r5142 r5169 17 17 */ 18 18 function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) { 19 global $wp_filter ;19 global $wp_filter, $merged_filters; 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 22 $wp_filter[$tag][$priority][serialize($function_to_add)] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 23 unset( $merged_filters[ $tag ] ); 23 24 return true; 24 25 } … … 38 39 */ 39 40 function apply_filters($tag, $string) { 40 global $wp_filter; 41 42 merge_filters($tag); 41 global $wp_filter, $merged_filters; 42 43 if ( !isset( $merged_filters[ $tag ] ) ) 44 merge_filters($tag); 43 45 44 46 if ( !isset($wp_filter[$tag]) ) … … 69 71 */ 70 72 function merge_filters($tag) { 71 global $wp_filter ;72 73 if ( is set($wp_filter['all']) )73 global $wp_filter, $merged_filters; 74 75 if ( is_array($wp_filter['all']) ) 74 76 $wp_filter[$tag] = array_merge($wp_filter['all'], (array) $wp_filter[$tag]); 75 77 … … 78 80 uksort($wp_filter[$tag], "strnatcasecmp"); 79 81 } 82 $merged_filters[ $tag ] = true; 80 83 } 81 84 … … 93 96 */ 94 97 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { 95 global $wp_filter ;98 global $wp_filter, $merged_filters; 96 99 97 100 unset($GLOBALS['wp_filter'][$tag][$priority][serialize($function_to_remove)]); 101 unset( $merged_filters[ $tag ] ); 98 102 99 103 return true;
Note: See TracChangeset
for help on using the changeset viewer.