Print all WordPress hooks

Ever needed to print out all the hooks in the sequence they are being called (for example to find a good hook to modify a particular behavior)?

add_filter( 'all', function( $tag ) {
	echo "apply_filters($tag)<br/>";
} );
add_action( 'all', function( $tag ) {
	echo "do_action($tag)<br/>";
} );

Is a quick and easy way to do this via a small modification in wp-settings.php (after plugin.php is included).

Posted in Web

Leave a Reply

Only people in my network can comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)