需求:表单发送之后,我们能知道访客是从哪一个页面发送的。
Contact form 7 中有Special tag,专门记录,只需要在邮件内容中增加短代码[_url];
Impreza自带的Contact form没有这样的代码,我们需要找到 (addon插件中)cform.php
在第188行左右,把
$email_body = '<p>' . __( 'You received a message from', 'us' ) . ' <a href="' . site_url() . '">' . get_bloginfo( 'name' ) . '</a></p>';
改为
$email_body .= '<p>' . __( 'Inquiry From2', 'us' ) . ' <a href="' . htmlspecialchars($_SERVER['HTTP_REFERER']) . '">' . htmlspecialchars($_SERVER['HTTP_REFERER']) . ' </a> </p> ';
学习资源
https://code.tutsplus.com/categories/wordpress