did_action
Retrieve the number of times an action is fired.
Description
(int) did_action( (string) $tag );
Returns (int)
The number of times action hook $tag is fired.
Parameters (1)
- 0. $tag (string)
- The name of the action hook.
Usage
if ( !function_exists( 'did_action' ) ) { require_once ABSPATH . WPINC . '/plugin.php'; } // The name of the action hook. $tag = ''; // NOTICE! Understand what this does before running. $result = did_action($tag);
Defined (2)
The function is defined in the following location(s).
- /wp-includes/plugin.php
- function did_action($tag) {
- global $wp_actions;
- if ( ! isset( $wp_actions[ $tag ] ) )
- return 0;
- return $wp_actions[$tag];
- }
- /wp-admin/includes/noop.php
- function did_action() {}