Keep up to date with Gravity PDF

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

Jump To Section

Description #description

This method allows you to retrieve a single global Gravity PDF setting, or return a default if it’s non-existent (much like WordPress’s get_option() function).

Version #version

This method was introduced in Gravity PDF 4.0.

Parameters #parameters

$key | string
The global PDF setting name
$default | mixed | optional
What’s returned if the $key doesn’t exist. Defaults to an empty string.

Return #return

mixed
The PDF setting value (if any), otherwise the $default value.

Usage #usage

The following snippet shows you how to retrieve the default_pdf_size global PDF option:

add_action( 'init', function() {
    if ( class_exists( 'GPDFAPI' ) ) {
        $default_pdf_size = GPDFAPI::get_plugin_option( 'default_pdf_size' );
    }
} );

Source Code #source-code

This method is located in api.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 (¥)