Created
July 14, 2021 19:48
-
-
Save jorpdesigns/7783d66c20414cba4d2146b4315a7672 to your computer and use it in GitHub Desktop.
Snippet to convert HTML entities in Gravity Forms entries to formatted characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To use, add ':decode' to merge tag e.g. HTML Field:1:decode | |
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value, $format ) { | |
if ( $merge_tag != 'all_fields' && $modifier == 'decode' ) { | |
$value = htmlspecialchars_decode( $value ); | |
} | |
return $value; | |
}, 10, 6 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment