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



did_action ›

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

Retrieve the number of times an action is fired.



源码

function did_action( $tag ) {
	global $wp_actions;

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

	return $wp_actions[ $tag ];
}