Keep up to date with Gravity PDF

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

Jump To Section

Description #description

While Gravity Forms provides its own API, we wanted to abstract that functionality and really fine tune the methods we needed (we don’t implement everything in the Gravity Forms API). We recommend reviewing the src/helper/Helper_Form.php file for full details.

Version #version

This method was introduced in Gravity PDF 4.0.

Return #return

\GFPDF\Helper\Helper_Form | object
The form class

Usage #usage

This snippet shows how to access our form class and get a Gravity Form:

add_action( 'init', function() {
    if ( class_exists( 'GPDFAPI' ) ) {
        /* Get Gravity PDF form class */
        $gform = GPDFAPI::get_form_class();

        /* You could use GFAPI::get_form() but we found performance problems when called multiple times */
        $form = $gform->get_form( 10 ); /* 10 is the form ID we want to get */
    }
} );

Source Code #source-code

This method is located in api.php and the misc class can be found in src/helper/Helper_Form.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 (¥)