What is “all” in isset($wp_filter[‘all’])

all is just a string the WordPress developers picked to behave differently than any other hook. When you attach to all, your callback will fire for all other hooks.

I wouldn’t spend too much time looking at the source of do_action, just know that:

  1. add_action( 'x', 'whatever' ) will mean whatever fires for do_action( 'x' )
  2. add_action( 'all', 'whatever' ) will mean whatever fires for every do_action, regardless of the name of the hook.

Leave a Comment

tech