given this:
<?php add_action( $hook, $function_to_add, $priority, $accepted_args ); ?>
Is there a way to get $hook
value inside the function $function_to_add
?
The name of the current hook is always current_filter()
. Despite its name, this function returns the name of actions too.
Usage example: Move the textarea in a comment form.
The current priority is: key( $GLOBALS['wp_filter'][ $hook ] )
.
current_action
wrapper for those who find it strange to use current_filter
in action callbacks ;-)