Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
Gravity PDF v4 will receive bug fixes and security updates until October 4, 2019, however it's recommended you upgrade to v5 as soon as practical.
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.
Scroll To Top

Choose your currency:

Close
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 (¥)