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 01 Answer
Reset to default 0You 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条)