Skip to content

Instantly share code, notes, and snippets.

@techjewel
Last active November 6, 2022 21:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save techjewel/6a9e84aeecbf833ce087c83572ee8809 to your computer and use it in GitHub Desktop.
Save techjewel/6a9e84aeecbf833ce087c83572ee8809 to your computer and use it in GitHub Desktop.
<?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