On this page
did_filter( string $hook_name ): int
Retrieves the number of times a filter has been applied during the current request.
Parameters
$hook_namestring 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. View all references
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. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/did_filter