fluentform_form_imported

Description #

This action is fired after a form is imported. So you can use this hook and run your script after a form is imported

/*
* Source Action
*/
do_action('fluentform_form_imported', $formId);

Usage #

The following would apply to all forms:

add_action('fluentform_form_imported', 'your_custom_function', 10, 1);

function your_custom_function($formId)
{
   // Do your stuff here
}

Here is another example.

class GenerateStyle{
    
     public function __construct()
     {
        add_action('flentform_form_duplicated', array($this, 'regenrateStyle'), 10, 1);
     }
     
     public function regenrateStyle($formId)
     {
         $styles = Helper::getFormMeta($formId, 'ff_form_styles');         
         if ($styles) {             
             $stylerGenerator = new FormStylerGenerator();             
             $css = $stylerGenerator->generateFormCss('.fluentform_wrapper' . $formId, $styles);
             Helper::setFormMeta($formId, '_ff_form_styler_css', $css);
             do_action('fluentform_after_style_generated', $formId);
         }
     }
}

Parameters #

  • $formId (int) Form ID

Source Code #

This hook is located in fluentform/app/Modules/Form/Transfer.php

Powered by BetterDocs

Leave a Reply

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