0

I have a plugin filter that isn't working for me:

add_filter( 'gform_notification_email_3', 'route_notification', 10, 2 );
function route_notification($email_to, $entry) {
    global $post;
    $email_to = get_the_author_email();
    return $email_to;
}

I think the $email_to variable isn't being set properly, but how do I echo this variable out to check it?

1 Answer 1

1

Like usual. :) Works most of the time unless it ends up in some place that is not echoed to the screen by browser.

echo $email_to;

And for debug it is more informational to use var_dump(). Personally I usually use this to quickly add/remove dump to filter:

add_filter('filter','dump_filter',10, 1); // 1, or how many arguments the filter passes.

function dump_filter($input) {

    var_dump(func_get_args());

    return $input;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.