0

I'm about to create a very simple logging plugin.

Every time an action or filter is fired I need to log it to the file. The idea is that we will be able to see exactly which actions and filters are executed (and functions they run) for every page load. This includes the order that they run in.

1

The callbacks hooked onto 'all' are called prior to the callbacks for any hook (action and filters) being called. (See source)

add_action( 'all', 'wpse115617_all_hooks' );

function wpse115617_all_hooks(){
   //This is called for every filter & action

   //You can get the current hook to which it belongs with:
   $hook = current_filter();

}

See http://queryposts.com/function/current_filter/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.