admin管理员组

文章数量:1290946

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?

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 asked Apr 18, 2011 at 15:42 jnthnclrkjnthnclrk 1,8454 gold badges25 silver badges52 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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;
}

本文标签: pluginsWhat39s the best way to echo out a filter variable