我在 WordPress 中使用 Contact Form 7 并且有以下字段:
<div class="checkbox">[checkbox subscribed default:1 "Send me occasional email updates"]</div>
“Send me occasional email updates”成为输入标签,选择该选项时的值为“Send me occasional email updates”。
我希望值为 0 或 1。
我似乎找不到办法做到这一点。
您可以使用一个“接受”字段来执行此操作,但它更适用于接受条款和条件,因为它需要勾选复选框 - 而我提供了选择加入/退出的选项,所以我不能使用它.
最佳答案
您可以在复选框的表单中使用这样的短代码来发送 value="1":
[checkbox optout use_label_element "Opt-Out of Insights and Communications|1"]
然后要在您需要使用的邮件消息中显示原始值:
[_raw_optout]
我使用最新的 wp 和 cf7 的作品
关于wordpress - 在 Contact Form 7 中将复选框选项值更改为 1 或 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39556253/