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



did_action › WordPress Function

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

Retrieves the number of times an action has been fired during the current request.



源码

function did_action( $hook_name ) {
	global $wp_actions;

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

	return $wp_actions[ $hook_name ];
}