This file contains hidden or 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 | |
| /* | |
| * Create a custom shortcode for email / confirmation or other after form submit | |
| * Usage: {my_custom_shortcode} | |
| * @param $value string original shortcode string | |
| * @param $parser class \FluentForm\App\Services\FormBuilder\ShortCodeParser | |
| */ | |
| add_filter('fluentform_shortcode_parser_callback_my_custom_shortcode', function ($value, $parser) { |
This file contains hidden or 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 hidden or 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 the folliwing code to your theme's functions.php file. | |
| * This code will only load if a page has fluent forms. | |
| */ | |
| add_action('fluentform_before_form_render', function () { | |
| static $isloaded = false; | |
| if($isloaded) { |
This file contains hidden or 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
| (function($){ | |
| if(typeof gtag != 'function') { | |
| return; | |
| } | |
| var fluentForms = $('form.frm-fluent-form'); | |
| fluentForms.each(function() { | |
| var $form = $(this); | |
| var formId = $form.attr('data-form_id'); | |
| gtag('event', 'ViewForm', { |
This file contains hidden or 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 hidden or 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 Attachment to the email notification dynamically. | |
| * @param $attachments array - Array of the attachments. | |
| * @param $notification array - Email Notification array | |
| * @param $form object - The Form Object | |
| * @param $data array - The input submission data | |
| * @return array | |
| */ |
This file contains hidden or 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
| /** | |
| * Function to prevent users mark more than expected items. | |
| * This code must need to be placed in custom JS of your form | |
| * @param: containerClass String - The contaner class of the target checkbox block. | |
| * You can add a custom container class in the form settings | |
| * | |
| * @param: maxChecked Integer - Max Number of items user can mark | |
| * @return: void | |
| * | |
| */ |
This file contains hidden or 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
| /* | |
| * Add this js snippet in Form's JS box | |
| */ | |
| function capitalizeFLetter() { | |
| var $input = $form.find('.ff-name-field-wrapper').find('input'); | |
| $input.on('blur', function() { | |
| var string = $(this).val(); | |
| if(string) { | |
| string = string[0].toUpperCase() + string.slice(1); |