A WordPress-centric search engine for devs and theme authors



did_action ›

Since2.1.0
Deprecatedn/a
did_action ( $tag )
Parameters:
  • (string) $tag The name of the action hook.
    Required: Yes
Returns:
  • (int) The number of times action hook $tag is fired.
Defined at:
Codex:

Retrieve the number of times an action is fired.



Source

function did_action( $tag ) {
	global $wp_actions;

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

	return $wp_actions[ $tag ];
}