Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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,2); // or how much it passes, etc

function dump_filter($input) {

    var_dump(func_get_args());

    return $input;
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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