Ticket #5231: has_filter.diff
File has_filter.diff, 2.7 KB (added by , 17 years ago) |
---|
-
wp-includes/plugin.php
79 79 } 80 80 81 81 /** 82 * Check if a filter has been registered for a hook 83 * @package WordPress 84 * @subpackage Plugin 85 * @since 2.4 86 * @global array $wp_filter Stores all of the filters 87 * 88 * @param string $tag The name of the filter hook. 89 * @return boolean 90 */ 91 function has_filter($tag) { 92 global $wp_filter; 93 94 return isset($wp_filter[$tag]); 95 } 96 97 /** 82 98 * Call the functions added to a filter hook. 83 99 * 84 100 * The callback functions attached to filter hook <tt>$tag</tt> are invoked by … … 377 393 } 378 394 379 395 /** 396 * Check if an action has been registered for a hook 397 * @package WordPress 398 * @subpackage Plugin 399 * @since 2.4 400 * @global array $wp_action Stores all of the actions 401 * 402 * @param string $tag The name of the action hook. 403 * @return boolean 404 */ 405 function has_action($tag) { 406 global $wp_action; 407 408 return isset($wp_action[$tag]); 409 } 410 411 /** 380 412 * Removes a function from a specified action hook. 381 413 * 382 414 * This function removes a function attached to a specified action hook. This -
wp-includes/classes.php
238 238 } 239 239 240 240 // query_string filter deprecated. Use request filter instead. 241 global $wp_filter; 242 if ( isset($wp_filter['query_string']) ) { // Don't bother filtering and parsing if no plugins are hooked in. 241 if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. 243 242 $this->query_string = apply_filters('query_string', $this->query_string); 244 243 parse_str($this->query_string, $this->query_vars); 245 244 } -
wp-settings.php
20 20 21 21 wp_unregister_GLOBALS(); 22 22 23 unset( $wp_filter, $ cache_lastcommentmodified, $cache_lastpostdate );23 unset( $wp_filter, $wp_action, $cache_lastcommentmodified, $cache_lastpostdate ); 24 24 25 25 if ( ! isset($blog_id) ) 26 26 $blog_id = 1; -
wp-admin/includes/plugin.php
329 329 } 330 330 331 331 function get_plugin_page_hook( $plugin_page, $parent_page ) { 332 global $wp_filter;333 334 332 $hook = get_plugin_page_hookname( $plugin_page, $parent_page ); 335 if ( isset( $wp_filter[$hook] ))333 if ( has_action($hook) ) 336 334 return $hook; 337 335 else 338 336 return null;