WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/has action

Description

Check if any action has been registered for a hook.

Usage

<?php has_action$tag$function_to_check ?>

Parameters

$tag
(string) (required) The name of the action hook.
Default: None
$function_to_check
(callback) (optional) If specified, return the priority of that function on this hook or false if not attached.
Default: false

Return Values

(integer|boolean) 
Optionally returns the priority on that hook for the specified function.

Examples

Notes

  • See has_filter() has_action is an alias of has_filter().
  • Since this action is an alias of has_filter() it also uses the global array $wp_filter that stores all of the filters / actions.

Change Log

Since: 2.5

Source File

has_action() is located in wp-includes/plugin.php.

Related

Action Functions

See also index of Function Reference and index of Template Tags.