Skip to main content
Version: v6

gfpdf_wp_kses_allowed_pdf_styles

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 inline CSS styles in any Core/Universal template.

Version

This filter was introduced in Gravity PDF 6.4.2

Parameters

$tags | array

  • An array of allowed CSS property names that can be used inline in the style attribute

Usage

Adds support for the custom mPDF CSS property margin-collapse:

add_filter( 'gfpdf_wp_kses_allowed_pdf_styles', function( $styles ) {
$styles[] = 'margin-collapse';

return $styles;
} );

Source Code

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