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

Create a Customer in Stripe without Capturing Payment

Capturing a Stripe customer through your form is easy with Gravity Forms, even if you’re not charging them yet. You can create a customer in your Stripe.com dashboard, including their payment details, without actually charging the customer using this tutorial.

Create Post with Custom Taxonomy

In this snippet, we will show you how to create a WordPress post using a custom taxonomy.

Defining Minimum Add-On Requirements

As of Gravity Forms 2.2, add-ons can now easily define requirements that are needed before the add-on can be used. Defining requirements is as simple as overriding the minimum_requirements function in the GFAddOn class.

Deleting Cached Entry Data

This snippet will allow you to delete the cached entry data when viewing an entry.

Disabling Mobile Keyboard Input on Datepicker Fields

This quick block of Javascript will allow you to disable keyboard input within Date fields. This snippet is helpful if you need to avoid the virtual keyboard from appearing within the datepicker.

Display a message on the login form when the user is pending activation

Use the WordPress authenticate filter to check if the user attempting to login is still pending activation so a custom message can be displayed

Enable Use of the Total Field with Conditional Logic

The Total field can’t be used to configure conditional logic rules, but this snippet makes that possible.

Hiding the Form Title

This article about how to hide the form title in Gravity Forms outside of the shortcode, includes a CSS snippet on how to do it.

Highlighting the Current or Future Date in the Datepicker

This article explains how to highlight the current or future date in the datepicker using a jQuery code snippet.

How to Add a Custom Field Group when Using the Field Framework

When using the field framework to include new field types, you can override the add_button() method to add a custom field group if it doesn’t already exist.