Developer Snippets

This section contains short guides and code examples for developers working with the Gravity Forms field framework. You’ll find practical snippets for setting default field properties, customizing field behavior, and making simple modifications with the GFAPI.

Articles

How to Add a New Field to an Existing Form Using the GFAPI

This articles explains how to add a new field to an existing form programmatically using the Gravity Forms API.

How to Add Delayed Payment Support to a Feed Add-On

Adding support for delaying feed processing until after a PayPal payment has been successfully completed is as simple as adding one line to your add-on.

How to Set the Default Properties for a New Field

This article shows how the SetDefaultValues_ function can be used with get_form_editor_inline_script_on_page_render() to set the default properties for a new field.

Including a New Field Using the Add-On Framework

In this article we will show how you can use the add-on framework to include a new field type which extends the GF_Field class.

Including and Using Entry Meta with the Add-On Framework

The get_entry_meta() function can be overridden to include custom entry meta when creating an add-on which uses the Add-On Framework.

Including Scripts and Styles when Using the Add-On Framework

Scripts and styles can be included for an add-on by overriding the scripts() and styles() functions with structured arrays.

Sending Notifications on Custom Events when Using the Add-On Framework

Since Gravity Forms 1.9.12, add-ons which extend GFFeedAddOn or GFPaymentAddOn can register custom events for which they will send notifications.

Using EDD Software Licensing with the Add-On Framework

Add-ons can be integrated with the EDD Software Licensing extension to handle license key activation, deactivation, validation, and enable automatic updates.