Version: 5
🔥 Gravity PDF v5 end of life was 2023-04-28 and this version is no longer supported. This legacy documentation is kept for reference only.
gfpdf_get_option
Description
This option allows you to override individual global PDF settings when they are accessed.
You also have the option to use the gfpdf_get_option_$option
filter, where $option
is the global setting ID.
Parameters
$value | mixed
- The PDF settings
$key | string
- The current Gravity Form ID the PDF is being added to
$default | mixed
- The ID of the current PDF being processed
Usage
The following snippet shows how you can change a global PDF setting option:
add_action( 'gfpdf_get_option', function( $value, $key, $default ) {
/* Let's change the default template value when it's requested */
if( 'default_template' == $key ) {
$value = 'rubix';
}
return $value;
}, 10, 3 );
You can also specifically target an option:
add_action( 'gfpdf_get_option_default_template', function( $value, $key, $default ) {
$value = 'rubix';
return $value;
}, 10, 3 );
Source Code
This filter is located in the Helper_Abstract_Options::get_option()
method of /src/helper/abstract/Helper_Abstract_Options.php
.