string|array doing_filter( string $event_name );
This construct returns the name of the event (action hook) that is being processed. It may not be the one that is currently calling its callbacks, as it is possible to have multiple events firing at the same time. If you want the current one, i.e. the one that is calling its callbacks right now, then use
- optional The name of the event you want to check.
If an event name is passed into the construct, then it returns
true if that event is being processed.
If no event name is provided, then it returns an array of all the events that are being processed.
You get WET when you swim. Stay DRY when you code.
More coming soon…keep checking back.
These are the PHP constructs used in WordPress Core for