API Functions
Articles
GFAPI Examples for Forms and Entries
While the Gravity Forms API is very powerful, it is actually extremely easy to use. In this article, we will get you started in using the Gravity Forms API to access and manage information within Gravity Forms.
GFAPI Class
The Gravity Forms API Functions provides developers with a future-proof way to access some of the common core functionality in Gravity Forms.
gf_has_filters
Determines if a callback has been registered for the specified filter. [php]
gf_has_filters( array( 'filter_name', $modifier1 ) );
[/php].
gf_has_action
Determines if a callback has been registered for the specified action. [php]
gf_has_action( array( 'action_name', $modifier1 ) );
[/php].
Getting Forms with the GFAPI
The GFAPI includes methods that can be used to get and check if forms exist.
Getting Fields with the GFAPI
The GFAPI::get_fields_by_type() and GFAPI::get_field() methods are used to get form fields.
Deleting Forms with the GFAPI
The GFAPI::delete_form() and GFAPI::delete_forms() methods are used to delete forms.
Deleting Entries with the GFAPI
The GFAPI::delete_entry() method is used to permanently delete an entry.
Creating Forms with the GFAPI
The GFAPI::add_form(), GFAPI::add_forms(), and GFAPI::duplicate_form() methods are used to create forms.
Creating Entries with the GFAPI
The GFAPI::add_entry() and GFAPI::add_entries() methods are used to add entries directly to the database.