Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.

Jump To Section

Description #description

This option allows you to override individual global PDF settings when they are updated in the database.

You also have the option to use the gfpdf_update_option_$option filter, where $option is the global setting ID.

Parameters #parameters

$value | mixed
The PDF settings
$key | string
The current Gravity Form ID the PDF is being added to

Usage #usage

The following snippet shows how you can change a global PDF setting option:

add_action( 'gfpdf_update_option', function( $value, $key ) {
    /* Let's change the default template value when it's requested */
    if( 'default_template' == $key ) {
        $value = 'rubix';
    }

    return $value;
}, 10, 2 );

You can also specifically target an option:

add_action( 'gfpdf_update_option_default_template', function( $value, $key ) {
    $value = 'rubix';
    return $value;
}, 10, 2 );

Source Code #source-code

This filter is located in the Helper_Abstract_Options::update_option() method of /src/helper/abstract/Helper_Abstract_Options.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