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:
add_action( 'x', 'whatever' )
will meanwhatever
fires fordo_action( 'x' )
add_action( 'all', 'whatever' )
will meanwhatever
fires for everydo_action
, regardless of the name of the hook.