How to get current action?

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?

Related posts

Leave a Reply

2 comments

  1. This can be un-reliable because it depends on the values coming in from the registration_errors filter, but hopefully you get the idea.

    function checkQuestion($var1, $var2 = '', $var3 = '') {
            if(empty($var2) && empty($var3)) {
                // You are on the preprocess_comment filter because you did not receive a total of three variables
            } else {
                // You are on the registration_errors filter because $var2 and $var3 are not empty
            }
            return $var1;       
        }