File manager - Edit - /home/targetcrm/htdocs/www.targetcrm.cloud/wp-content/themes/target-crm/functions.php
Back
<?php /** * Target CRM Theme functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package Target CRM * @since 1.0.0 */ /** * Define Constants */ define( 'CHILD_THEME_TARGET_CRM_VERSION', '1.0.0' ); /** * Enqueue styles */ function child_enqueue_styles() { wp_enqueue_style( 'target-crm-theme-css', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), CHILD_THEME_TARGET_CRM_VERSION, 'all' ); } add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 ); //hook check /** * This will fire at the very end of a (successful) form entry. * * @link https://wpforms.com/developers/wpforms_process_complete/ * * @param array $fields Sanitized entry field values/properties. * @param array $entry Original $_POST global. * @param array $form_data Form data and settings. * @param int $entry_id Entry ID. Will return 0 if entry storage is disabled or using WPForms Lite. */ function wpf_dev_process_complete( $fields, $entry, $form_data, $entry_id ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #5. if ( (absint( $form_data[ 'id' ] ) !== 3468) && (absint( $form_data[ 'id' ] ) !== 3475) ) { return; } $entry = wpforms()->entry->get( $entry_id ); $entry_fields = json_decode( $entry->fields, true ); //print_r($entry_fields); $ch = curl_init(); //contact form if ( absint( $form_data[ 'id' ] ) == 3468 ) { $curlConfig = array( CURLOPT_URL => "https://ecs.targetcrm.co.in/LeadsAPI.php", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => array( "_operation" => "InsertLead", "name" => $entry_fields[0][ 'value' ], "email" => $entry_fields[2][ 'value' ], "mobile" => $entry_fields[3][ 'value' ], "remark" => $entry_fields[4][ 'value' ], "leadstatus" => "Not Contacted", "company" => $entry_fields[1][ 'value' ], ) ); } //request demo if ( absint( $form_data[ 'id' ] ) == 3475 ) { $curlConfig = array( CURLOPT_URL => "https://ecs.targetcrm.co.in/LeadsAPI.php", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => array( "_operation" => "InsertLead", "name" => $entry_fields[0][ 'value' ], "email" => $entry_fields[2][ 'value' ], "mobile" => $entry_fields[3][ 'value' ], "remark" => $entry_fields[4][ 'value' ], "leadstatus" => "Request For Demo", "company" => $entry_fields[1][ 'value' ], ) ); } curl_setopt_array($ch, $curlConfig); $result = curl_exec($ch); //print_r($result); curl_close($ch); //die; //$entry_fields = json_encode( $entry_fields ); //wpforms()->entry->update( $entry_id, array( 'fields' => $entry_fields ), '', '', array( 'cap' => false ) ); } add_action( 'wpforms_process_complete', 'wpf_dev_process_complete', 10, 4 );
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings