Last active
November 6, 2022 21:39
-
-
Save techjewel/6a9e84aeecbf833ce087c83572ee8809 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
* Fluent Forms Extra Smartcodes on form integration feeds | |
* This code will add a new item on the smartcode dropdown. | |
* if you don't want to show the smartcode then you may skip this. | |
*/ | |
add_filter('fluentform_form_settings_smartcodes', function ($groups) { | |
$groups[0]['shortcodes']['{my_custom_smartcode}'] = 'Custom All Data'; | |
return $groups; | |
}); | |
/* | |
* Callback for {my_custom_smartcode} smartcode for integration feed | |
*/ | |
add_filter('fluentform_shortcode_parser_callback_my_custom_smartcode', function ($return, $instance) { | |
$form = $instance::getForm(); | |
$entry = $instance::getEntry(); | |
$formFields = \FluentForm\App\Modules\Form\FormFieldsParser::getEntryInputs($form); | |
$inputLabels = \FluentForm\App\Modules\Form\FormFieldsParser::getAdminLabels($form, $formFields); | |
$response = \FluentForm\App\Modules\Form\FormDataParser::parseFormSubmission($entry, $form, $formFields, true); | |
$html = 'This is your html or whatever you want to create from the available data'; | |
return $html; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment