This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Catch submission the before it's inserting in database | |
* if you want to log the data in the database use hook: fluenform_before_submission_confirmation | |
*/ | |
add_action('fluentform_before_insert_submission', function ($insertData, $data, $form) { | |
if($form->id != 156) { // 156 is our target form id | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gtag('event', 'ViewForm', { | |
'event_category': 'FluentForms', | |
'event_label': 'View Form', | |
'form_id': formId | |
}); | |
$form.on('fluentform_submission_success', function() { | |
gtag('event', 'FormSubmission', { | |
'event_category': 'FluentForms', | |
'event_label': 'Form Submitted', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// changing summary email body text | |
add_filter('fluentform_email_summary_body_text', function ($text) { | |
return 'Your own Email Body Text'; | |
}); | |
// changing email footer text | |
add_filter('fluentform_email_summary_footer_text', function ($text) { | |
return 'Powered by your agency'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('fluentform_editor_vars', function($vars) { | |
$bulkOptionsJson = $vars['bulk_options_json']; | |
$arrays = json_decode($bulkOptionsJson, true); | |
$arrays['New Option Group'] = ['Option 1', 'Option 2']; | |
$vars['bulk_options_json'] = json_encode($arrays); | |
return $vars; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inject Link Form Settings Menu | |
add_filter('fluentform_form_settings_menu', function ($items) { | |
$items['my_menu_slug'] = [ | |
'title' => 'My Menu Title', | |
'slug' => 'my_settings_slug' | |
]; | |
return $items; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function distance($lat1, $lng1, $lat2, $lng2) | |
{ | |
// convert latitude/longitude degrees for both coordinates | |
// to radians: radian = degree * π / 180 | |
$lat1 = deg2rad($lat1); | |
$lng1 = deg2rad($lng1); | |
$lat2 = deg2rad($lat2); | |
$lng2 = deg2rad($lng2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FluentFormCustomImporter | |
{ | |
protected function getDemoForms() | |
{ | |
return [ | |
'[{"id":"9","title":"Contact Form Demo","status":"published","appearance_settings":null,"form_fields":{"fields":[{"index":0,"element":"input_name","attributes":{"name":"names","data-type":"name-element"},"settings":{"container_class":"","admin_field_label":"Name","conditional_logics":[]},"fields":{"first_name":{"element":"input_text","attributes":{"type":"text","name":"first_name","value":"","id":"","class":"","placeholder":"First Name"},"settings":{"container_class":"","label":"First Name","help_message":"","visible":true,"validation_rules":{"required":{"value":false,"message":"This field is required"}},"conditional_logics":[]},"editor_options":{"template":"inputText"}},"middle_name":{"element":"input_text","attributes":{"type":"text","name":"middle_name","value":"","id":"","class":"","placeholder":"","required":false},"settings":{"container_class":"","label":"Middle Name","help_message":"","error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Fluent Forms Extra Smartcodes on form integration feeds | |
* This code will add a new item on the smartcode dropdown. | |
* if you don't want to show the smartcode then you may skip this. | |
*/ | |
add_filter('fluentform_form_settings_smartcodes', function ($groups) { | |
$groups[0]['shortcodes']['{my_custom_smartcode}'] = 'Custom All Data'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('fluentcrm_confirmation_head', function ($subscriber) { | |
$redirectUrl = 'https://google.com'; // Change this url; | |
echo '<meta http-equiv="refresh" content="0; URL='.$redirectUrl.'" />'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Function to push a task for background processing | |
* @param: string $callbackName - Your classback acction name | |
* @param: mixed $payload - Your payload data that you will get when procssing on callback | |
*/ | |
function my_custom_queue_on_background($callbackName, $payload) | |
{ |