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

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *