Title: priority
Last modified: August 21, 2016

---

# priority

 *  [viperfunk](https://wordpress.org/support/users/viperfunk/)
 * (@viperfunk)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/)
 * I have a question about the “priority” value passed to addAction().
 *  While the documentation reads “Used to specify the order in which the functions
   associated with a particular action are executed. Lower numbers correspond with
   earlier execution, and functions with the same priority are executed in the order
   in which they were added to the action.”
 *  My question is, how do I find out the existing order of priorities for an action?
   Say “login” ? If I want something to happen when the username is checked, what
   priority value is that? How about right before the username is checked, or right
   after the password is checked?
 *  Is there somewhere that lists this information?
 *  Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Shaun Scovil](https://wordpress.org/support/users/sscovil/)
 * (@sscovil)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861833)
 * Here is a great way to check out [which functions are hooked onto a filter](http://stackoverflow.com/questions/5224209/wordpress-how-do-i-get-all-the-registered-functions-for-the-content-filter).
 * A similar solution for actions would be:
 *     ```
       function print_actions_for( $action = '' ) {
           global $wp_actions;
           if( empty( $action ) || !isset( $wp_actions[$action ] ) )
               return;
   
           print '<pre>';
           print_r( $wp_actions[$action] );
           print '</pre>';
       }
       ```
   
 * And use it by calling:
 * `print_actions_for( 'wp_head' );`
 *  Thread Starter [viperfunk](https://wordpress.org/support/users/viperfunk/)
 * (@viperfunk)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861834)
 * Nice one, going to have to give that a go. Cheers 🙂
 *  [Shaun Scovil](https://wordpress.org/support/users/sscovil/)
 * (@sscovil)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861837)
 * Actually, I just tested it and it prints ‘1’ for true or ‘0’ for false! :-/
 * This works:
 *     ```
       function var_dump_actions_for( $action = '' ) {
           global $wp_actions;
           if( empty( $action ) || !isset( $wp_actions[$action ] ) )
               return;
   
           var_dump( $wp_actions[$action] );
       }
       ```
   
 * …and call using: `var_dump_actions_for( 'wp_head' );`
 *  [Shaun Scovil](https://wordpress.org/support/users/sscovil/)
 * (@sscovil)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861840)
 * Wait! No it doesn’t…
 * …hang on…
 *  [Shaun Scovil](https://wordpress.org/support/users/sscovil/)
 * (@sscovil)
 * [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861841)
 * Ah, here it is. Just do this:
 * `var_dump( $wp_filter );`
 * That lists all of the filters and action hooks. The keys in the arrays look like
   the priorities for each hooked function.
 * Also see [this article](http://wp.smashingmagazine.com/2012/02/16/inside-wordpress-actions-filters/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘priority’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [Shaun Scovil](https://wordpress.org/support/users/sscovil/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/priority-1/#post-3861841)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
