Skip to content

Instantly share code, notes, and snippets.

@jorpdesigns
Created July 14, 2021 19:48
Show Gist options
  • Save jorpdesigns/7783d66c20414cba4d2146b4315a7672 to your computer and use it in GitHub Desktop.
Save jorpdesigns/7783d66c20414cba4d2146b4315a7672 to your computer and use it in GitHub Desktop.
Snippet to convert HTML entities in Gravity Forms entries to formatted 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