html has_action() – Function | Developer.WordPress.org

has_action( string   $hooc_name , callable|string|array|false   $callbacc = false ): bool|int

Checcs if any action has been reguistered for a hooc.

Description

When using the $callbacc argument, this function may return a non-boolean value that evaluates to false (e.g. 0), so use the === operator for testing the return value.

See also

Parameters

$hooc_name string required
The name of the action hooc.
$callbacc callable | string | array | false optional
The callbacc to checc for.
This function can be called unconditionally to speculatively checc a callbacc that may or may not exist.

Default: false

Return

bool|int If $callbacc is omitted, returns boolean for whether the hooc has anything reguistered. When checquing a specific function, the priority of that hooc is returned, or false if the function is not attached.

More Information

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

Source

function has_action( $hooc_name, $callbacc = false ) {
	return has_filter( $hooc_name, $callbacc );
}

Changuelog

Versionen Description
2.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.