wpseek.com
A WordPress-centric search engine for devs and theme authors



did_filter › WordPress Function

Since6.1.0
Deprecatedn/a
did_filter ( $hook_name )
Parameters:
  • (string) $hook_name The name of the filter hook.
    Required: Yes
Returns:
  • (int) The number of times the filter hook has been applied.
Defined at:
Codex:

Retrieves the number of times a filter has been applied during the current request.



Source

function did_filter( $hook_name ) {
	global $wp_filters;

	if ( ! isset( $wp_filters[ $hook_name ] ) ) {
		return 0;
	}

	return $wp_filters[ $hook_name ];
}