Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
This is the legacy Gravity PDF v4 documentation which is NOT supported. Go to the latest documentation.
Jump To Section

Description #description

Use this filter to modify the [gravitypdf] shortcode attribute properties before they are processed.

Parameters #parameters

$attributes | array
The current shortcode attributes being processed. By default these include: id, text, type, class, entry and print. See our shortcode documentation for more details on what each of these attributes do.

Usage #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 #source-code

This filter is located in the Model_Shortcodes::gravitypdf() method of /src/model/Model_Shortcodes.php.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Gravity PDF 40K Active Installs Celebration! Take 20% off any products with coupon 40KMILESTONE (this week only)Visit Store
+ +
Scroll To Top

Choose your currency:

Converted prices are for reference only - all orders are charged in $ Australian Dollars ($) AUD.
  • AUDAustralian Dollars ($)
  • USDUS Dollars ($)
  • CADCanadian Dollars ($)
  • EUREuros (€)
  • GBPPound Sterling (£)
  • NZDNew Zealand Dollar ($)
  • JPYJapanese Yen (¥)