shortcode - How to insert a short code into Contact Form 7 in Wordpress that will call a function once the submit button is pres

How (or where) do I insert a short code that will call a function (written in a plugin called 'code snippets')

How (or where) do I insert a short code that will call a function (written in a plugin called 'code snippets') when the submit button is pressed. I am trying to get the submit button to send data to an external database instead of sending mail. I have the actual function written already but no matter where I place the short code nothing happens when the submit button is pressed. The external database lives on the same IP address as the wp database. I have been struggling with this short code for a bit of time now so thought I would pose the question.

How (or where) do I insert a short code that will call a function (written in a plugin called 'code snippets') when the submit button is pressed. I am trying to get the submit button to send data to an external database instead of sending mail. I have the actual function written already but no matter where I place the short code nothing happens when the submit button is pressed. The external database lives on the same IP address as the wp database. I have been struggling with this short code for a bit of time now so thought I would pose the question.

Share Improve this question asked Jun 20, 2019 at 17:16 Robin OlsenRobin Olsen 33 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

You can achieve it by changing the action of the particular form and then use the function to store the data in the database into a new file.

add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
function wpcf7_custom_form_action_url($url)
{
    global $post;
    $id_to_change = 1;
    if($post->ID === $id_to_change)
        return 'wheretopost.asp';
    else
        return $url;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745382670a4625301.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信