Title: doing_action
Published: April 25, 2014
Last modified: August 20, 2026

---

# doing_action( string|null $hook_name = null ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#wp--skip-link--target)

Returns whether or not an action hook is currently being processed.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#description)󠁿

The function [current_action()](https://developer.wordpress.org/reference/functions/current_action/)
only returns the most recent action being executed.
[did_action()](https://developer.wordpress.org/reference/functions/did_action/)
returns the number of times an action has been fired during the current request.

This function allows detection for any action currently being executed (regardless
of whether it’s the most recent action to fire, in the case of hooks called from
hook callbacks) to be verified.

### 󠀁[See also](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#see-also)󠁿

 * [current_action()](https://developer.wordpress.org/reference/functions/current_action/)
 * [did_action()](https://developer.wordpress.org/reference/functions/did_action/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#parameters)󠁿

 `$hook_name`string|nulloptional

Action hook to check. Defaults to null, which checks if any action is currently 
being run.

Default:`null`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#return)󠁿

 bool Whether the action is currently in the stack.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#source)󠁿

    ```php
    function doing_action( $hook_name = null ) {
    	return doing_filter( $hook_name );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/plugin.php#L672)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/plugin.php#L672-L674)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#related)󠁿

| Uses | Description | 
| [doing_filter()](https://developer.wordpress.org/reference/functions/doing_filter/)`wp-includes/plugin.php` |

Returns whether or not a filter hook is currently being processed.

  |

| Used by | Description | 
| [WP_Connector_Registry::set_instance()](https://developer.wordpress.org/reference/classes/wp_connector_registry/set_instance/)`wp-includes/class-wp-connector-registry.php` |

Sets the main instance of the registry class.

  | 
| [wp_register_ability_category()](https://developer.wordpress.org/reference/functions/wp_register_ability_category/)`wp-includes/abilities-api.php` |

Registers a new ability category.

  | 
| [wp_register_ability()](https://developer.wordpress.org/reference/functions/wp_register_ability/)`wp-includes/abilities-api.php` |

Registers a new ability using the Abilities API. It requires three steps:

  | 
| [wp_enqueue_stored_styles()](https://developer.wordpress.org/reference/functions/wp_enqueue_stored_styles/)`wp-includes/script-loader.php` |

Fetches, processes and compiles stored core styles, then combines and renders them to the page.

  | 
| [wp_enqueue_global_styles()](https://developer.wordpress.org/reference/functions/wp_enqueue_global_styles/)`wp-includes/script-loader.php` |

Enqueues the global styles defined via theme.json.

  | 
| [wp_add_privacy_policy_content()](https://developer.wordpress.org/reference/functions/wp_add_privacy_policy_content/)`wp-admin/includes/plugin.php` |

Declares a helper function for adding content to the Privacy Policy Guide.

  | 
| [_load_textdomain_just_in_time()](https://developer.wordpress.org/reference/functions/_load_textdomain_just_in_time/)`wp-includes/l10n.php` |

Loads plugin and theme text domains just-in-time.

  | 
| [wp_oembed_add_discovery_links()](https://developer.wordpress.org/reference/functions/wp_oembed_add_discovery_links/)`wp-includes/embed.php` |

Adds oEmbed discovery links in the head element of the website.

  | 
| [wp_cron()](https://developer.wordpress.org/reference/functions/wp_cron/)`wp-includes/cron.php` |

Registers [_wp_cron()](https://developer.wordpress.org/reference/functions/_wp_cron/) to run on the [‘shutdown’](https://developer.wordpress.org/reference/hooks/shutdown/) action.

  | 
| [load_default_textdomain()](https://developer.wordpress.org/reference/functions/load_default_textdomain/)`wp-includes/l10n.php` |

Loads default translated strings based on locale.

  | 
| [wp_version_check()](https://developer.wordpress.org/reference/functions/wp_version_check/)`wp-includes/update.php` |

Checks WordPress version against the newest version.

  | 
| [wp_save_post_revision()](https://developer.wordpress.org/reference/functions/wp_save_post_revision/)`wp-includes/revision.php` |

Creates a revision for the current version of a post.

  |

[Show 7 more](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/doing_action/?output_format=md#comment-content-1528)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/doing_action/#comment-1528)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fdoing_action%2F%23comment-1528)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fdoing_action%2F%23comment-1528)
 4. **Check whether the ‘save_post’ action is being executed**
 5.     ```php
        if ( doing_action( 'save_post' ) ) {
        	// Do awesome here.
        }
        ```
    
 6. **Check if any action is being executed**
 7.     ```php
        if ( doing_action() ) {
        	// Do awesome here.
        }
        ```
    
 8.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fdoing_action%2F%3Freplytocom%3D1528%23feedback-editor-1528)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fdoing_action%2F)
before being able to contribute a note or feedback.