Shortcodes in form fields unrendered upon Ajax validation [RESOLVED]

Hi, I use WordPress shortcodes in HTML fields as well as in the Description of Section and (product) Option fields. They render just fine on the initial page load, but if Ajax is enabled and there’s a validation error, the shortcodes are “un-rendered”—I see the shortcode instead of its expansion. I know I could use the gform_save_field_value filter to render the shortcodes when saving the form, but the main purpose of my shortcodes is to make the fields easier to edit for my customer, and the textarea inputs are already so small in the editor. How can I tell Gravity Forms to render shortcodes again upon Ajax validation?

Gravity Forms doesn’t actually process the shortcodes when the form is first displayed. They are processed by the theme or page builder when it runs the page content through the WP shortcode processor.

Try adding the following to the theme functions.php file or a code snippets plugin.

add_filter( 'gform_get_form_filter', 'do_shortcode' );
2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.