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_filter('fluentform_validate_input_item_input_password', function($errorMessage, $field, $formData, $fields, $form){ | |
| $target_form_id = 9; | |
| if($form->id != $target_form_id){ | |
| return; | |
| } | |
| $password = $formData['password']; | |
| $errorMessage = ''; | |
| //numbers | |
| $pattern = "/[0-9]/"; |
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 | |
| 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 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_action('fluentform_before_form_render', 'your_custom_function_ff', 10, 1); | |
| function your_custom_function_FF( $form ) | |
| { | |
| $target_form_id = 11; | |
| $substract_from = 100; | |
| $message = "spots available!"; | |
| if($form->id !=$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
| add_filter('fluenform_rendering_field_data_select', function ($data, $form) { | |
| $target_formId= 91; // form ID | |
| $post_type= 'books'; //your post type | |
| if ($form->id != $target_formId) { | |
| // return $data; | |
| } | |
| // check if the name attriibute is 'job_list' | |
| if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'job_list') { |
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
| //1. Make sure to enter form ID isntead of 20 | |
| //2. match your address field name attribute is same as address_1 | |
| //3. Add your own error message | |
| add_action('fluentform_before_insert_submission', function ($insertData, $data, $form){ | |
| $target_formId = 14; | |
| $blacklist_string = 'CO4 6BP,CM4 6BP'; | |
| $msg = "Sorry! Your error message !"; |
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
| let minus; | |
| jQuery('body').on('click','.js-repeat-buttons',function(){ | |
| calculate(); | |
| }) | |
| function calculate(){ | |
| let length = jQuery('.calculate .ff_repeater_table tbody tr').length | |
| let sum = 0; | |
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 | |
| // ** Fluent Form custom input component : Show suggestion from wp post titles | |
| // 1. Paste this in your theme function.php file or you can | |
| // create a new file in active theme directory and include the file | |
| if (!defined('ABSPATH')) { | |
| exit; | |
| } |
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_action('fluentform_before_form_render', 'ff_single_entry_per_user', 10, 1); | |
| function ff_single_entry_per_user( $form ) | |
| { | |
| $target_form_id = 1; | |
| $message = "Submission Done! Thanks."; | |
| $hideForm = true; | |
| if($form->id !=$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 | |
| /* | |
| * Say we want to change data of table id 1477 then you can write the following | |
| * code. | |
| * $data is the array of frontend data | |
| */ | |
| add_filter('ninja_tables_get_public_data', function ($data, $tableId) { | |
| if ($tableId == 1477) { | |
| $data[] = [ | |
| 'name' => 'Dynaic Name', |
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_filter('fluenform_rendering_field_data_select', function ($data, $form) { | |
| if ($form->id != 3) { | |
| return $data; | |
| } | |
| // check if the name attriibute is 'dropdown' , it is by default dropdown for the first dropdown input | |
| if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'dropdown') { | |
| return $data; |