使用JSON发送使用JSON发送的哪些参数联系表7 [英] What Parameter Contact Form 7 using JSON to sent using API
本文介绍了使用JSON发送使用JSON发送的哪些参数联系表7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为联系表单7创建API.
I want create API for contact form 7.
如何使用WP rest API将数据从前端发送到Contact Form 7? 我的意思是,通过POST方法发送数据的数据结构应该是什么?
How to send data from front-end to Contact Form 7 using WP rest api? I mean, what should the data structure be to send it via the POST method?
http://xx.xxx/wp-json/contact-form-7/v1/contact-forms/<id-form>/feedback
我尝试了不同的方式,但请求始终返回响应"validation_failed",一个或多个字段包含错误的数据.请检查它们,然后重试."
I trying different ways, but request always return response "validation_failed", "One or more fields contain erroneous data. Please check them and try again."
我在文档中没有发现任何有关此的信息.
I did not find anything about this in the documentation.
推荐答案
add_filter( 'wpcf7_mail_components', 'show_cf7_request', 10, 3 );
function show_cf7_request( $components, $wpcf7_get_current_contact_form, $instance ) {
print_r($_REQUEST);
die();
return $components;
};
不要尝试LIVE;)
这篇关于使用JSON发送使用JSON发送的哪些参数联系表7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文