Skip to main content
Version: v6

gfpdf_wp_kses_allowed_html

Description

To improve security, in Gravity PDF 6.4 we introduced a number of changes to how templates get rendered. To that end, all HTML mark-up generated by Gravity PDF in Core and Universal templates is now sanitizing by a customized wp_kses() function.

Use this filter to modify the allowed HTML tags in any Core/Universal template.

Version

This filter was introduced in Gravity PDF 6.4.2

Parameters

$tags | array

Usage

Add support for the <formfeed> mPDF control tag:

add_filter( 'gfpdf_wp_kses_allowed_html', function( $tags ) {

$tags['formfeed'] = [
'orientation' => true,
'type' => true,
'resetpagenum' => true,
'pagenumstyle' => true,
'suppress' => true,
'page-selector' => true,
'margin-left' => true,
'margin-right' => true,
'margin-top' => true,
'margin-bottom' => true,
'odd-header-name' => true,
'odd-footer-name' => true,
'odd-header-value' => true,
'odd-footer-value' => true,
];

return $tags;
} );

Source Code

This filter is located in the Kses.php files in the /src/Statics/ directory.