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?

1 Answer 1


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 ] ).

  • 3
    @Reigel ... and then there's the current_action wrapper for those who find it strange to use current_filter in action callbacks ;-)
    – birgire
    Apr 29, 2015 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.