This file contains hidden or 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 | |
| class FluentFormCustomImporter | |
| { | |
| protected function getDemoForms() | |
| { | |
| return [ | |
| '[{"id":"9","title":"Contact Form Demo","status":"published","appearance_settings":null,"form_fields":{"fields":[{"index":0,"element":"input_name","attributes":{"name":"names","data-type":"name-element"},"settings":{"container_class":"","admin_field_label":"Name","conditional_logics":[]},"fields":{"first_name":{"element":"input_text","attributes":{"type":"text","name":"first_name","value":"","id":"","class":"","placeholder":"First Name"},"settings":{"container_class":"","label":"First Name","help_message":"","visible":true,"validation_rules":{"required":{"value":false,"message":"This field is required"}},"conditional_logics":[]},"editor_options":{"template":"inputText"}},"middle_name":{"element":"input_text","attributes":{"type":"text","name":"middle_name","value":"","id":"","class":"","placeholder":"","required":false},"settings":{"container_class":"","label":"Middle Name","help_message":"","error |
This file contains hidden or 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 | |
| add_filter('fluentform_predefined_forms', function ($demoForms) { | |
| $demoForms['nicolas_form_1'] = array( | |
| 'screenshot' => '', // You may add your form screenshot here | |
| 'createable' => true, | |
| 'title' => 'Form 1 by Nicolas', | |
| 'tag' => ["nicolas form"], |
This file contains hidden or 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 | |
| /* | |
| * If you want to return raw provided url without any sanitization and security check then you can use this snippet. | |
| */ | |
| add_filter('fluentform_submission_confirmation', function ($returnData, $form, $confirmation) { | |
| if(empty($returnData['redirectUrl'])) { | |
| return $returnData; | |
| } |
This file contains hidden or 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 | |
| // Inject Link Form Settings Menu | |
| add_filter('fluentform_form_settings_menu', function ($items) { | |
| $items['my_menu_slug'] = [ | |
| 'title' => 'My Menu Title', | |
| 'slug' => 'my_settings_slug' | |
| ]; | |
| return $items; |
This file contains hidden or 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 | |
| /* | |
| * Add Browser Language smartcode on Fluent Forms Editor | |
| */ | |
| add_filter('fluentform_editor_shortcodes', function ($groups) { | |
| $groups[0]['shortcodes']['{browser_lang}'] = 'Browser Language'; | |
| return $groups; | |
| }); | |
| add_filter('fluentform_editor_shortcode_callback_browser_lang', function ($val) { |
This file contains hidden or 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 | |
| add_filter('fluentform_editor_vars', function($vars) { | |
| $bulkOptionsJson = $vars['bulk_options_json']; | |
| $arrays = json_decode($bulkOptionsJson, true); | |
| $arrays['New Option Group'] = ['Option 1', 'Option 2']; | |
| $vars['bulk_options_json'] = json_encode($arrays); | |
| return $vars; | |
| }); |
This file contains hidden or 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
| // required css | |
| <style> | |
| span.ff_submitting { | |
| display: none; | |
| } | |
| .ff-working span.ff_submitting { | |
| display: block; | |
| } |
This file contains hidden or 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
| // required css | |
| <style> | |
| span.ff_submitting { | |
| display: none; | |
| } | |
| .ff-working span.ff_submitting { | |
| display: block; | |
| } |
This file contains hidden or 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 | |
| function myFluentCrmTagIdBySlug($slug) { | |
| $tag = \FluentCrm\App\Models\Tag::where('slug', $slug)->first(); | |
| if($tag) { | |
| $tagId = $tag->id; | |
| } | |
This file contains hidden or 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 | |
| add_action('fluentcrm_confirmation_head', function ($subscriber) { | |
| $redirectUrl = 'https://google.com'; // Change this url; | |
| echo '<meta http-equiv="refresh" content="0; URL='.$redirectUrl.'" />'; | |
| }); |