did_filter( string $hook_name )
Retrieves the number of times a filter has been applied during the current request.
Parameters
- $hook_name
-
(Required) The name of the filter hook.
Return
(int) The number of times the filter hook has been applied.
Source
File: wp-includes/plugin.php
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. |