Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
This is the documentation for version 4 of Gravity PDF. See version 3 docs here.

Jump To Section

Description #description

Our options class handles all the settings registration and display, as well as providing a full CRUD (create, read, update, delete) for our stored global and individual PDF settings. All the CRUD functionality is available directly through our API so you won’t need to call it from the options class directly. For full details about utilising the options class we recommend reviewing the src/helper/abstract/Helper_Abstract_Options.php file.

Version #version

This method was introduced in Gravity PDF 4.0.

Return #return

\GFPDF\Helper\Helper_Options_Fields | object
The options class

Usage #usage

This snippet shows how to access our options class and get a list of Gravity PDF’s supported paper size:

add_action( 'init', function() {
    if ( class_exists( 'GPDFAPI' ) ) {
        /* Get Gravity PDF options class */
        $options    = GPDFAPI::get_options_class();
        $paper_size = $options->get_paper_size();
        //Do what ever you want with the paper size array
    }
} );

Source Code #source-code

This method is located in api.php and the options class can be found in 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