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.

Think I’m a super cool guy? Love my beard?

Share this post:

There is one comment

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