我使用的是elementor wordpress插件。我已经用elementor pro plugin制作了一个表单。我想在表单提交时获取数据,并使用表单数据发送外部api调用。我研究了elementor文档,但没有找到清晰的代码样本。是否有一种方法可以将表单数据发送到外部api。
发布于 2019-01-25 19:30:18
在对elementor插件做了大量研究之后。我找到解决方案了。我在我的自定义插件中添加了以下钩子,它就可以工作了。
add_action( 'wp_ajax_elementor_pro_forms_send_form', [ $this, 'ajax_send_form' ] );
add_action( 'wp_ajax_nopriv_elementor_pro_forms_send_form', [ $this, 'ajax_send_form' ] );
function ajax_send_form() {
// form processing code here
}https://stackoverflow.com/questions/54346700
复制相似问题