Skip to main content
Version: 4

Gravity PDF API – get_plugin_option()

Jump To Section


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).


This method was introduced in Gravity PDF 4.0.


$key | string : The global PDF setting name

$default | mixed | optional : What's returned if the $key doesn't exist. Defaults to an empty string.


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


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

This method is located in api.php.