Skip to content

Instantly share code, notes, and snippets.

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';
@alex-authlab
alex-authlab / fluent-form-entry-delete-bulk.php
Last active August 29, 2023 18:03
Fluent Form Entry Delete Bulk
/*
* 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) {
@alex-authlab
alex-authlab / ff-reset-user-pass.php
Created January 23, 2021 09:24
wp fluent form reset user pass
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' => [
@alex-authlab
alex-authlab / fluent-form-address-autcomplete.php
Last active January 13, 2023 15:44
Fluent Form populate address fields from API
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 ){
@alex-authlab
alex-authlab / fluent form age calculate
Last active January 8, 2023 22:27
Birthday Calculation in Fluent Form
// 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() {
// 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(){
@alex-authlab
alex-authlab / custom-entry-status.php
Created December 14, 2020 08:03
Custom Entry Status For Fluent Forms
<?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'
@alex-authlab
alex-authlab / fluenform_rendering_field_data_input_text.php
Created July 9, 2020 08:51
Fluent Form field data input filter
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 );
@alex-authlab
alex-authlab / fluentform-php-hooks.php
Created June 17, 2021 11:51
FluentForm PHP hooks list
<?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
@alex-authlab
alex-authlab / ff-custom-redirect-filter.php
Last active November 5, 2022 21:08
Fluent Form custom redirect filter
add_filter('fluentform_submission_confirmation', function($returnData, $form, $confirmation )
{
if($form->id != 11){
return;
}
$returnData['redirectUrl'] = 'http://google.com';
$returnData['message'] = "Redirecting";