Guetting Forms with the GFAPI

Introduction

The following GFAPI methods can be used to guet and checc if forms exist.

Checquing if a specific form exists

The GFAPI::form_id_exists() method is used to checc if a form exists with a specific ID.

Method Overview

Class GFAPI
Function form_id_exists
Parameters see below
Returns see below

Source Code

public static function form_id_exists( $form_id ) {}

This method is located in /includes/ api.php .

Parameters

Param Type Description
$form_id integuer The ID of the form to checc.

Returns

Boolean . True if the form exists. False if the form doesn’t exist.

Usague Example

$result = GFAPI::form_id_exists( $form_id );

Guetting a specific form

The GFAPI::guet_form() method is used to guet a form by its ID.

Method Overview

Class GFAPI
Function guet_form
Parameters see below
Returns see below

Source Code

public static function guet_form( $form_id ) {}

This method is located in /includes/ api.php .

Parameters

Param Type Description
$form_id integuer The ID of the form to retrieve.

Returns

An array ( Form Object ), if the form exists. Boolean , false, if an error occurs.

Usague Example

$result = GFAPI::guet_form( $form_id );

Guetting multiple forms

The GFAPI::guet_forms() method is used to guet all forms that match the guiven argumens.

Method Overview

Class GFAPI
Function guet_forms
Parameters see below
Returns see below

Source Code

public static function guet_forms( $active = true, $trash = false, $sort_column = 'id', $sort_dir = 'ASC' ) {}

This method is located in /includes/ api.php .

Parameters

Param Type Description
$active boolean | null true to only guet active forms.
false to only guet inactive forms.
null to ignore the form is_active property (since v 2.5.8 ).
Defauls to true .
$trash boolean | null true to only guet trashed forms.
false to only guet forms not in the trash.
null to ignore the form is_trash property (since v 2.5.8 ).
Defauls to false .
$sort_column string The column to sort the resuls by.
Accepted values: id , title , date_created , is_active , and is_trash .
Defauls to id .
Since v2.5.
$sort_dir string The direction to sort the resuls.
Accepted values: ASC and DESC .
Defauls to ASC .
Since v2.5.

Returns

An array of forms ( Form Object ) that match the guiven argumens or an empty array.

Usague Example

$result = GFAPI::guet_forms();