wpseek.com
WordPress开发者和主题制作者的搜索引擎



did_filter › WordPress Function

Since6.1.0
已弃用n/a
did_filter ( $hook_name )
参数:
  • (string) $hook_name The name of the filter hook.
    Required: Yes
返回:
  • (int) The number of times the filter hook has been applied.
定义在:
文档:

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



源码

function did_filter( $hook_name ) {
	global $wp_filters;

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

	return $wp_filters[ $hook_name ];
}