Checks if any action has been registered for a hook.
Description
When using the $callback 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.
Parameters
$hook_namestring
The name of the action hook.
$callbackcallable|string|array|falseoptional
The callback to check for. This function can be called unconditionally to speculatively check a callback that may or may not exist. Default false.Default: false
$priorityint|falseoptional
The specific priority at which to check for the callback. Default false.Default: false
Return
bool|int
If $callback is omitted, returns boolean for whether the hook has anything registered. When checking a specific function, the priority of that hook is returned, or false if the function is not attached. If $callback and $priority are both provided, a boolean is returned for whether the specific function is registered at that priority.
Uses · 1
has_filter()Checks if any filter has been registered for a hook.
wp_enqueue_registered_block_scripts_and_styles()Enqueues registered block scripts and styles, depending on current rendered context (only enqueuing editor scripts while in context of the editor).
wp_hoist_late_printed_styles()Adds the hooks needed for CSS output to be delayed until after the content of the page has been established.
Signature, return type and hooks compared across 5 parsed releases.
6.9.7
Parameter $priority added.verified against source
6.9.0
Added the $priority parameter.from the docblock
2.5.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/plugin.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.