has_filter [ WordPress Function ]
has_filter ( $tag, $function_to_check = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Check if any filter has been registered for a hook.
Source
<?php
function has_filter($tag, $function_to_check = false) {
global $wp_filter;
$has = !empty($wp_filter[$tag]);
if ( false === $function_to_check || false == $has )
return $has;
if ( !$idx = _wp_filter_build_unique_id($tag, $function_to_check, false) )
return false;
foreach ( (array) array_keys($wp_filter[$tag]) as $priority ) {
if ( isset($wp_filter[$tag][$priority][$idx]) )
return $priority;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/has filter « WordPress Codex
Description. Check if any filter has been registered for a hook. Usage. <?php has_filter( $tag, $function_to_check ); ?> Parameters. $tag: (string) (required) The ...
codex.wordpress.org - Howto use the has_filter wordpress function with an object based ...
Take a look at the _wp_filter_build_unique_id function defined at the bottom of wp-includes/plugin.php . That's where the array key for $wp_filters is ...
stackoverflow.com - The has_filter method should also take the $exclude parameter (or ...
Issue Summary. Right now the has_filter method of the query class does not have an option to match the #exclude parameter of a filter, which ...
drupal.org - Check if a Hook is being Filtered - Better WordPress
Feb 9, 2011 ... A somewhat not frequently used function that might help you determine whether a hook is being filtered or not.
betterwp.net