did_action( string $tag )

Retrieve the number of times an action is fired.


Parameters

$tag

(string) (Required) The name of the action hook.


Return

(int) The number of times action hook $tag is fired.


Source

File: wp-includes/plugin.php

function did_action($tag) {
	global $wp_actions;

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

	return $wp_actions[$tag];
}


Changelog

Changelog
Version Description
WP-2.1.0 Introduced.