Returning to previous page when return URL contains an "&"

Est. Reading: 1 minute
By: rojaco
Created: 06/27/2017
Category:
Difficulty: Beginner

Returning to previous page when return URL contains an "&"

×Warning: This tutorial was created 2587 days ago. Some of the information may be out of date with more recent versions of Formidable. Please proceed with caution and always perform a backup before adding custom code.

WordPress converts "&" to "&" when the hidden field used to store a return URL is saved.  This results in being redirected to an invalid URL after an entry is updated.  The following code added to your child theme functions.php solves the problem discussed here: https://Formidableforms.com/help-desk/using-return-to-previous-page-after-edit-code-has-issues-with/.  As always, make sure you have FTP access to your site before editing functions.php from the WordPress backend in case something goes wrong.

add_filter('frmpro_fields_replace_shortcodes', 'frm_replace_amp_entity_with_amp', 10, 4);
function frm_replace_amp_entity_with_amp($value, $tag, $atts, $field){
 if ( isset($atts['amp']) ) {
 $value = str_replace( "&", "&", $value);
 }
 return $value;
}

Leave a Reply

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crosschevron-leftchevron-rightarrow-right