Version: 5
CAUTION
️Version 5 of Gravity PDF does not have full support for Gravity Forms 2.5 and you should consider upgrading to version 6. If you cannot, version 5 will still function but have a degraded admin experience. Support and bug/security fixes will be provided until 27 April 2023.gfpdf_gravityforms_shortcode_attributes
Description
Use this filter to modify the [gravitypdf]
shortcode attribute properties before they are processed.
Parameters
$attributes | array
- The current shortcode attributes being processed. By default these include:
id
,text
,type
,class
,entry
andprint
. See our shortcode documentation for more details on what each of these attributes does.
Usage
This snippet shows you how to target a specific PDF's shortcode and include a custom class name:
add_filter( 'gfpdf_gravityforms_shortcode_attributes', function( $attributes ) {
/* Only modify the shortcode attributes from a specific PDF */
if ( '51281289afj212' == $attributes['id'] ) {
$attributes['class'] .= ' prefix-custom-css-class-name';
}
return $attributes;
} );
Source Code
This filter is located in the Model_Shortcodes::gravitypdf()
method of /src/model/Model_Shortcodes.php
.