did_action( string $tag )

Retrieve the number of times an action is fired.


Description


Parameters

$tag

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


Top ↑

Return

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


Top ↑

Source

File: wp-includes/plugin.php

function did_action( $tag ) {
	global $wp_actions;

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

	return $wp_actions[ $tag ];
}

Top ↑

Changelog

Version Description
2.1.0 Introduced.