Retrieves the number of times a filter has been applied during the current request.
Parameters
$hook_name
stringrequired- The name of the filter hook.
Source
function did_filter( $hook_name ) {
global $wp_filters;
if ( ! isset( $wp_filters[ $hook_name ] ) ) {
return 0;
}
return $wp_filters[ $hook_name ];
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.