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 badges1 Answer
Reset to default 1Like 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
版权声明:本文标题:plugins - What's the best way to echo out a filter variable? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741516361a2382912.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论