[wp-hackers] Detecting which action ran function
jw at jacksonwhelan.com
Fri Aug 12 15:03:35 UTC 2011
I think you may want to look at the global $wp_current_filter which is
set in the do_action()  function according to what action is being
Alternatively you could create wrapper functions for each action, and
use them to pass a variable to your main function which would determine
Hope that helps,
On 8/12/11 10:36 AM, Robert Lusby wrote:
> I have a function that is called from a number of different actions.
> The function does essentially the same, except for one small
> difference on output depending which action triggered it.
> How do you detect which WP action has called the function?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers