did_action() – Retrieves the number of times an action has been fired during the current request.

You appear to be a bot. Output may be restricted

Description

Retrieves the number of times an action has been fired during the current request.

Usage

$int = did_action( $hook_name );

Parameters

$hook_name
( string ) required – The name of the action hook.

Returns

int The number of times the action hook has been fired.

Source

File name: wordpress/wp-includes/plugin.php
Lines:

1 to 9 of 9
function did_action( $hook_name ) {
  global $wp_actions;

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

  return $wp_actions[ $hook_name ];
}
 

 View on GitHub View on Trac