Useful Snippets

Table of Contents
<?php

// Disable default css for all the forms
add_filter('fluentform_load_default_public', '__return_false');

// disable default css for the specific forms

add_filter('fluentform_load_default_public', function($status, $form) {
    $targetForms = [1,2,3]; // form ids that you want to disable default styles
    if(in_array($form->id, $targetForms)) {
        return false;
    }
    return $status;
}, 10, 2);

Shuffle Inputs #

<?php

// This will apply for only form id: 14
 
add_filter('fluentform_rendering_form', function ($form) {

    // change form ID
    $targetFormId = 14;
    if ($form->id != $targetFormId) {
        return $form;
    }
    list($fixed_inputs, $inputs_to_suffle) = array_chunk($form->fields['fields'], 2);
    shuffle($inputs_to_suffle);
    $form->fields['fields'] = array_merge($fixed_inputs,$inputs_to_suffle);
    
    return $form;
}, 10, 1);

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *