Changeset 6318
- Timestamp:
- 11/06/2007 09:38:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r6316 r6318 108 108 */ 109 109 function apply_filters($tag, $value) { 110 global $wp_filter, $merged_filters; 110 global $wp_filter, $merged_filters, $wp_current_filter; 111 112 @$wp_current_filter[] = $tag; 111 113 112 114 // Do 'all' actions first … … 121 123 } 122 124 123 if ( !isset($wp_filter[$tag]) ) 125 if ( !isset($wp_filter[$tag]) ) { 126 array_pop($wp_current_filter); 124 127 return $value; 128 } 125 129 126 130 // Sort … … 143 147 144 148 } while ( next($wp_filter[$tag]) !== false ); 149 150 array_pop( $wp_current_filter ); 145 151 146 152 return $value; … … 183 189 184 190 /** 191 * Return the name of the current filter or action. 192 */ 193 function current_filter() { 194 global $wp_current_filter; 195 return end( $wp_current_filter ); 196 } 197 198 199 /** 185 200 * Hooks a function on to a specific action. 186 201 * … … 234 249 */ 235 250 function do_action($tag, $arg = '') { 236 global $wp_action, $wp_actions ;251 global $wp_action, $wp_actions, $wp_current_filter; 237 252 238 253 if ( is_array($wp_actions) ) … … 249 264 $args[] = func_get_arg($a); 250 265 266 @$wp_current_filter[] = $tag; 267 251 268 // Do 'all' actions first 252 269 if ( isset($wp_action['all']) ) { … … 259 276 } 260 277 261 if ( !isset($wp_action[$tag]) ) 278 if ( !isset($wp_action[$tag]) ) { 279 array_pop($wp_current_filter); 262 280 return; 263 281 } 282 264 283 // Sort 265 284 if ( !isset( $merged_actions[ $tag ] ) ) { … … 278 297 } while ( next($wp_action[$tag]) !== false ); 279 298 299 array_pop($wp_current_filter); 280 300 } 281 301
Note: See TracChangeset
for help on using the changeset viewer.