gfpdf_process_merge_tags_in_submitted_rich_text
Description
Gravity PDF doesn't process merge tags or shortcodes a user submits in a form field. Prior to 6.18 a Rich Text Paragraph or Post Body field would process merge tags, and this filter turns this feature back on.
Only process submitted merge tags on forms where you trust everyone who can submit an entry. A user can enter any merge tag, like {all_fields} or {user:user_email}, and its value will be shown in the PDF.
For shortcodes, or merge tags in other field types, see gfpdf_skip_encode_mergetags_on_fields.
Version
This filter was introduced in Gravity PDF 6.18.0.
Parameters
$process | bool
- Whether to process the submitted merge tags. Default
falseon new installs,trueif you upgraded from < 6.18
$field | GF_Field
- The Gravity Forms field object
$entry | array
- The Gravity Forms entry object
$form | array
- The Gravity Forms form object
Usage
Only process them on form ID 5:
add_filter( 'gfpdf_process_merge_tags_in_submitted_rich_text', function( $process, $field, $entry, $form ) {
return (int) $form['id'] === 5;
}, 10, 4 );
Only process them in field ID 3 on form ID 5:
add_filter( 'gfpdf_process_merge_tags_in_submitted_rich_text', function( $process, $field, $entry, $form ) {
return (int) $form['id'] === 5 && (int) $field->id === 3;
}, 10, 4 );
Disable merge tag processing completely:
add_filter( 'gfpdf_process_merge_tags_in_submitted_rich_text', '__return_false' );
Source Code
This filter is located in the Helper_Abstract_Fields::process_value_tags() method of /src/Helper/Helper_Abstract_Fields.php.