I am developing custom registration form. Is it possible to get current action (comment adding or user registration) in function? For example i am using:
add_filter('preprocess_comment', 'checkQuestion');
add_filter('registration_errors', 'checkQuestion', 10, 3);
So, from function checkQuestion
i need somehow to know from what action it was called?
You can simply use
current_filter()
WordPress function.http://codex.wordpress.org/Function_Reference/current_filter
This can be un-reliable because it depends on the values coming in from the registration_errors filter, but hopefully you get the idea.