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/Services/Form/FormService.php