Skip to content

Instantly share code, notes, and snippets.

@pstoute
Last active November 10, 2022 03:30
Show Gist options
  • Save pstoute/fdb273b715febf223f21e57b572262b2 to your computer and use it in GitHub Desktop.
Save pstoute/fdb273b715febf223f21e57b572262b2 to your computer and use it in GitHub Desktop.
<?php
// Add this to your plugin or functions.php file. Then you can use the smart code "{stoute_funnels_form_data}" in the form. I use it as a hidden field.
/**
* Add Fluent Forms Custom Smart Code
* Since @1.0.11
**/
add_filter('fluentform_editor_shortcodes', function ($smartCodes) {
$smartCodes[0]['shortcodes']['{stoute_funnels_form_data}'] = 'Funnel Form Data';
return $smartCodes;
});
add_filter('fluentform_editor_shortcode_callback_stoute_funnels_form_data', function ($value, $form) {
$dynamicValue = get_post_meta( get_the_ID(), 'funnel_fluent_form_id', true );
return $dynamicValue;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment