Snippet of the Day: Listing All Actions Fired in WordPress

I’ve decided to begin offering quick code snippets every day. These can range, but will likely be mostly WordPress and PHP.  This first code snippet will allow you to see all of the actions fired within a particular request in WordPress.

add_action( 'shutdown', function(){
    foreach( $GLOBALS['wp_actions'] as $action => $count )
        printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );

Just toss that in any PHP file that you know will be firing on the desired page, and you’re good to go. Have a better solution? Let me know in the comments below.

1 comment

Leave a Reply to Adam Romanowski Cancel reply