您好,我正在使用以下代码更改Contact Form 7的表单数据值:
我想更新这个值,我该怎么做?
您好,我正在使用以下代码更改Contact Form 7的表单数据值:
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");
function wpcf7_do_something_else($cf7) {
$wpcf = WPCF7_ContactForm::get_current();
// get form data
$submission = WPCF7_Submission::get_instance();
if ($submission) {
// get submitted data
$posted_data = $submission->get_posted_data()['phone-271'];
$submission->get_posted_data()['phone-271'] = "456464646";
// Output the form data to the browser console
// echo '\<script\>console.log(' . $posted_data . ')\</script\>';
}
return $wpcf;
字符串
}
我想更新这个值,我该怎么做?`
1条答案
按热度按时间xa9qqrwz1#
这里是代码,你怎么能实现
字符串