在联系表单7字段

时间:2020-03-25 23:45:39

标签: php wordpress contact-form-7

我想在用Contact Form 7(WordPress插件)创建的表单中添加一些PHP。 我已经尝试过了,但是没有用:Executing PHP Code in Contact Form 7 Textarea。 每次插入该函数时,我的网站都会崩溃。

我在$ _SESSION中存储了一个变量。我已经将该变量放入隐藏的输入中,现在我想获取隐藏输入的值并将其放在联系表中。 我怎样才能做到这一点?谢谢!

Screenshot of the website and the hidden input

Screenshot of the back-end of the form

1 个答案:

答案 0 :(得分:2)

我认为这种方法对您有用。

  1. 设置链接的url参数。示例domain.com/more-info?previous-link=home-page
  2. 在您的表单中添加此字段

    [text* previous-link default:get default:post_meta "Previous link"]
    

您可以在docs

中看到更多示例