Skip to content

Instantly share code, notes, and snippets.

@Mosharush
Last active September 27, 2017 11:47
Show Gist options
  • Save Mosharush/725c433e9a6cb59a52f5ac7a62aa70f0 to your computer and use it in GitHub Desktop.
Save Mosharush/725c433e9a6cb59a52f5ac7a62aa70f0 to your computer and use it in GitHub Desktop.
Wipi (beaver) builder support for Contact Form 7 DB plugin
<?php
// Code start form here:
// Wipi (beaver) builder support for Contact Form 7 DB plugin
function webstorm_wipi_support_cf7db(){
// Save temp unnecessary post fields and remove untail save to db
$tempPost = $_POST;
unset( $_POST['fields'] );
unset( $_POST['action'] );
unset( $_POST['node_id'] );
// Extract fields data to global post
foreach( $tempPost['fields'] as $field ){
$_POST[ $field['label'] ] = $field['value'];
}
do_shortcode('[cfdb-save-form-post]');
// Revert post data
$_POST = $tempPost;
}
add_action( 'wp_ajax_nopriv_fl_builder_email_advanced', 'webstorm_wipi_support_cf7db', 1 );
add_action( 'wp_ajax_fl_builder_email_advanced', 'webstorm_wipi_support_cf7db', 1 );
add_action( 'wp_ajax_nopriv_fl_builder_email', 'webstorm_wipi_support_cf7db', 1 );
add_action( 'wp_ajax_fl_builder_email', 'webstorm_wipi_support_cf7db', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment