A member in the Fluent Form facebook group wanted a way to get the page slug.
We are going to create a smartcode that returns the page slug for the page we submit the form on.
Copy and paste the snippet below into functions.php
or code snippet plugin.
PHP
add_filter('fluentform_editor_shortcodes', function ($smartCodes) { $smartCodes[0]['shortcodes']['{page_slug}'] = 'Page slug'; return $smartCodes; }); add_filter('fluentform_editor_shortcode_callback_page_slug', function ($value, $form) { global $post; return $post->post_name; }, 10, 2);
Copy
Once you have added the snippet, you should see the smartcode display in the dropdown menu under default value.