Plugin Directory

Changeset 2391765


Ignore:
Timestamp:
10/01/2020 03:52:39 PM (6 years ago)
Author:
crmthrive
Message:

Added Divi Support

Location:
crm-thrive
Files:
20 added
2 edited

Legend:

Unmodified
Added
Removed
  • crm-thrive/trunk/crm-thrive.php

    r2328704 r2391765  
    55 * Plugin URI: https://www.crmthrive.com/
    66 * Description: Save the leads to Thrive system generated by various form plugins. We currently support CF7, Ninja Forms, WP Forms, Gravity Forms and Elementor Builder.
    7  * Version: 1.4
     7 * Version: 1.5
    88 * Author: Thrive
    99 * Author URI: https://profiles.wordpress.org/crmthrive/
     
    4040require_once WSL_INCLUDES_DIR . '/class-wsl-gravity-api.php';
    4141require_once WSL_INCLUDES_DIR . '/class-wsl-elementor-api.php';
     42require_once WSL_INCLUDES_DIR . '/class-wsl-divi-api.php';
    4243
    4344if(is_admin()){
     
    138139   
    139140}
     141
     142add_action( 'et_contact_page_email_to', 'wsl_divi' );
     143
     144function wsl_divi($contact_email){
     145    $fields = array();
     146    $id_array = array();
     147    $form_settings = array();
     148    $set_form = array();
     149    $form_fields = $_POST["et_pb_contact_email_fields_0"];
     150    $strip = stripslashes($_POST["et_pb_contact_email_fields_0"]);
     151    $decode_obj = json_decode($strip, true);
     152
     153    $form_settings["form_name"] = "Divi Form";
     154    $form_settings["form_fields"] = array();
     155    foreach($decode_obj as $k=>$v){
     156        if($v["field_type"] == 'input'){
     157            $type = "text";
     158        }
     159        if($v["field_type"] == 'text'){
     160            $type = "textarea";
     161        }
     162   
     163        $fields[$v["original_id"]] = array(
     164            "id"=>$v["original_id"],
     165            "type"=>$type,
     166            "title"=>$v["field_label"],
     167            "value"=>$_POST[$v["field_id"]],
     168            "raw_value"=>$_POST[$v["field_id"]],
     169            "required"=>($v["required_mark"] == "required") ? "1":""
     170        );
     171       
     172        $set_form[] = array(
     173            "custom_id"=>$v["original_id"],
     174            "field_label"=>$v["field_label"],
     175            "placeholder"=>$v["field_label"],
     176            "field_type"=>$type,
     177            "required"=>($v["required_mark"] == "required") ? "true":""
     178        );
     179        $form_settings["form_fields"] = $set_form;
     180    }
     181
     182    $laravel_api = new Wsl_Divi_Api($fields);
     183    $laravel_api->set_submission_instance($form_settings);
     184    $laravel_api->call();
     185}
  • crm-thrive/trunk/readme.txt

    r2328704 r2391765  
    44Requires at least: 2.0
    55Tested up to: 5.3.2
    6 Stable tag: 1.4
     6Stable tag: 1.5
    77Requires PHP: 5.2.4
    88License: GPLv2 or later
     
    4343= 1.4 =
    4444* Bug fixes address and name field mapping in cf7
     45
     46= 1.5 =
     47* Support for divi
Note: See TracChangeset for help on using the changeset viewer.