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
add_filter('fluentform_file_type_options', function ($types) { | |
$types[] = [ | |
'label' => __('3d files - DWG, STL, STEP, STP, SKP, MAX, FBX, 3DS, IGES, OBJ', 'fluentform'), | |
'value' => 'dwg|stp|stl|STEP|skp|max|fbx|3ds|iges|obj', | |
]; | |
return $types; | |
}); | |
add_filter('upload_mimes', function ($mime_types) { | |
$mime_types ['dwg'] = 'image/vnd.dwg'; |
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
/* | |
* insert in function.php & remove the code after deleting entries | |
*/ | |
add_action( 'plugins_loaded', function(){ | |
$formId= 8; // add your form ID | |
$startId = 20; // Entry Delete start from this ID | |
$endId = 21; // Entry Delete end with this ID | |
delete_entry($formId,$startId,$endId); | |
} ); | |
function delete_entry($formId,$start,$end) { |
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
add_action('fluentform_before_insert_submission', function ($insertData, $data, $form) { | |
if($form->id != 8) { // 23 is your form id. Change the 23 with your own login for ID | |
return; | |
} | |
$redirectUrl = home_url(); // You can change the redirect url after successful login | |
if (get_current_user_id()) { // user already registered | |
wp_send_json_success([ | |
'result' => [ |
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
add_filter('fluentform_rendering_field_data_address', function ($data,$form) | |
{ | |
// your form id | |
if($form->id != 1) { | |
return $data; | |
} | |
// the base adress field name | |
$addressField = 'address_1'; | |
if( $data['attributes']['name'] != $addressField ){ |
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
// Age calculator | |
// 1. First take a Date picker & a text input field | |
// 2. In the text input element add the class 'age' | |
// 3. Add a custom class 'date' in the date picker ,then add the following js in your fluent form custom js | |
jQuery( ".date" ).change(function() { |
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
// booking date check in > check out | |
// add the two class 'in-date' & 'out-date' | |
$( document ).ready(function() { | |
var check_in = flatpickr(".in-date",{dateFormat: "d/m/Y",}); | |
var check_out = flatpickr(".out-date",{dateFormat: "d/m/Y",}); | |
check_in.element.addEventListener("change", function(){ |
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 | |
/* | |
1. Add this in theme function.php or any PHP snippet plugin | |
2. Add your own status in the array | |
*/ | |
add_filter('fluentform_entry_statuses',function($data){ | |
$new_stat = [ | |
'checking'=> 'Checking', | |
'complete'=>'Completed' |
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
add_filter( 'fluenform_rendering_field_data_input_text', function($data,$form){ | |
$custom = ['value'=>'Hello','readonly'=>'true']; | |
$data['attributes'] =array_merge($data['attributes'] ,$custom); | |
return $data; | |
},10,2 ); |
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 | |
//form | |
do_action('fluentform_loaded'); | |
//do_action('fluentform_before_insert_submission', $insertData, $data, $this->form); | |
do_action('fluentform_before_form_actions_processing', $insertId, $this->formData, $this->form); | |
//do_action('fluenform_before_submission_confirmation', $insertId, $formData, $form); | |
//do_action('fluentform_submission_inserted', $insertId, $formData, $form); | |
//payment |
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
add_filter('fluentform_submission_confirmation', function($returnData, $form, $confirmation ) | |
{ | |
if($form->id != 11){ | |
return; | |
} | |
$returnData['redirectUrl'] = 'http://google.com'; | |
$returnData['message'] = "Redirecting"; |
NewerOlder