gf_do_action()

gf_do_action()

DescriptionUsageParametersExamplesSinceSource Code

Description

Gravity Forms pre-processing for do_action.

Allows additional actions based on form and field ID to be defined easily.

Usage

1gf_do_action( array( 'my_action_hook', $form_id ), $arg1, $arg2 );

Parameters

$action arrayArray containing the action hook as well as the modifier.

Examples

1gf_do_action( array( 'my_action_hook', $form_id ), $arg1, $arg2 );

Since

This function was added in Gravity Forms version 1.9.12.

Source Code

This action hook is located in gravityforms.php

GF_DEBUG

GF_DEBUG

DescriptionUsagePlacement

Description
This constant helps debugging problems with AJAX forms by allowing the contents of the AJAX iframe to be viewed. Set the constant to true to display the contents.
Usage
1define( 'GF_DEBUG', true );
Placement
This constant should be set in your wp-config.php. See the article Wp Config Options for more details.

Obtaining Your Capsule CRM API Key

Obtaining Your Capsule CRM API Key

To use the Capsule CRM Add-On, you will need to first obtain your Capsule CRM API key. In this article, we will show you exactly how to find it.

Log into your Capsule CRM account.
Click on your name at the top right corner and then on My Preferences.
From the left side menu, click API Authentication Tokens.
Under Personal Access Tokens, click the Generate new API token button.

Give the token a Description, and check the boxes as applicable.

Click the Save new Token button.

Now you can copy the token to use in your Gravity Forms Capsule CRM settings.
If you need further help to get your API key, we recommend you contact Capsule CRM support.

Obtaining Your Agile CRM API Key

Obtaining Your Agile CRM API Key

When using the Agile CRM Add-On for Gravity Forms, you will need to be able to authenticate with Agile CRM from your site. In this article, we will show you how to obtain your Agile CRM API key.

Log into your Agile CRM account.
From the top right of your main Agile CRM dashboard page, click on your name/icon, then click on Admin Settings.
From the left-hand menu, click on Developers & API. You will see your API key as well as your Javascript API key for tracking.

Getting the Form Field Filters with REST API v2

Getting the Form Field Filters with REST API v2

IntroductionMethodPathRequired PropertiesOptional PropertiesResponse [json]Usage ExamplesExample 1Example 2

Introduction
The field-filters endpoint was added in Gravity Forms 2.4.21.8, it returns the field filters for the specified form. Internally Gravity Forms uses the field filters to populate the search drop down on the entries list page and the filter condition settings on the sales/results pages. You can use the response from this endpoint to create similar features on remote sites or simply use it to help determine which keys and operators to use with the field_filters array of the GET entries search property.
Method
This endpoint only accepts GET requests.
Path
/gf/v2/forms/[FORM_ID]/field-filters
Required Properties
There are no required properties.
Optional Properties

_admin_labels – Use the value 「1」 to include the field admin labels in the response, if configured.

Response [json]
The response will contain a JSON object which contains the field filters for the specified form. Examples can be found below.
Usage Examples
Example 1
This example shows how to get the field filters for form id 577.

Example 2
This example shows how to get the field filters for form id 577 using the field admin labels, if configured.

Getting Started: A Checklist for the New User

Getting Started: A Checklist for the New User

Welcome To Gravity Forms!The BasicsExpanding Further

Welcome To Gravity Forms!
Getting started with Gravity Forms is a simple process, but there are a few steps you need to take. If you』re already familiar with installing WordPress plugins, you』re already ahead of the game.
In this article we have a checklist of the things you will need to do from the first moment you decide to use Gravity Forms, and links to a selection of the articles that can help you do it!
The Basics

Review our system requirements.
Purchase and pay for a Gravity Forms license key, which will then add your new license key to your Gravity Forms account. If you need to try out some functionality first, you can experiment with our fully functional online demo.
Download the Gravity Forms plug-in from your account.
Install the Gravity Forms plug-in.
Enter your license key into your plugin Settings to validate your installation of Gravity Forms.
Create your first form, and then start testing it out in the preview view, or add it to your test site and experiment!

You are up and running!
Expanding Further
Next steps or areas you might be interested in could include:

setting up notifications and confirmations.
reviewing your form submission, which Gravity Forms calls entries.
experimenting with more advanced fields.
extend your capabilities with our official add-ons or our community contributed third party add-ons!

Whatever you might need for your sites, Gravity Forms (and our online documentation) can help!

Getting Started with the PayPal Payments Pro Add-On

Getting Started with the PayPal Payments Pro Add-On

RequirementsInstallationSetupFeed CreationHelpful Links

Sometimes getting started with the PayPal Payments Pro Add-On can be a bit daunting. For someone who has never used it, there can be some challenges in knowing where to begin and where to continue on to. In this article, we will outline steps that you will take when setting up the PayPal Payments Pro Add-On for Gravity Forms.
Requirements
Important: PayPal requires PCI compliance when using PayPal Payments Pro. For more information on PCI compliance, you will need to contact your web host.
The following articles outline the requirements for the PayPal Payments Pro Add-On:
PayPal Payments Pro Requirements
The Gravity Forms system requirements will also apply. They can be found here:
Gravity Forms Requirements
Installation
Before you can use this PayPal Payments Pro Add-On, you』ll need to install it. Installation is the same process as installing Gravity Forms or any other WordPress plugin from a zip file. If you need more information on how to do so, the following article will walk you through the process:
Installing Gravity Forms Add-Ons
Setup
Initial setup of the PayPal Payments Pro Add-On involves adding your PayPal Payment Pro credentials, as well as adding a credit card field to your form. More information on these can be found at the following:
Setting Up the PayPal Payments Pro Add-On
If you wish to use a PayPal Payments Pro Sandbox account, and need help creating one, this article will get you started:
Creating PayPal Payments Pro Sandbox Accounts
Feed Creation
To use the PayPal Payments Pro Add-On with your form, you will need to first create a feed for it. This is similar to other add-on feeds. The following article will explain the process:
Creating PayPal Payments Pro Feeds
Helpful Links
Credit Card Fields
Product Fields
Credit Card Field CSS Classes
Canceling a PayPal Payments Pro Subscription

Examples

Examples

Getting and Manipulating FormsGetting All FormsGetting a Single FormUpdating a FormGetting and Manipulating EntriesGetting All EntriesGetting a Single EntryUpdate an Entry

Getting and Manipulating Forms
Obtaining and updating information is a quite simple process when using the GFAPI class. Below, you will see example on how you can easily retrieve and modify forms using the Gravity Forms API.
Getting All Forms
You may want to simply get information on all forms within Gravity Forms. It can be done as simply as this:
123
This will store your results within the $form variable. To view information on your results, you may call something like this:
1var_dump( $forms );
If you were to do so, you will see something like this:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677array(1) {  [0]=>  array(13) {    ["title"]=>    string(4) "Test"    ["description"]=>    string(0) ""    ["labelPlacement"]=>    string(9) "top_label"    ["descriptionPlacement"]=>    string(5) "below"    ["button"]=>    array(3) {      ["type"]=>      string(4) "text"      ["text"]=>      string(6) "Submit"      ["imageUrl"]=>      string(0) ""    }    ["fields"]=>    array(0) {    }    ["version"]=>    string(9) "1.9.11.15"    ["id"]=>    int(1)    ["notifications"]=>    array(1) {      ["55a3dddb74f59"]=>      array(7) {        ["id"]=>        string(13) "55a3dddb74f59"        ["to"]=>        string(13) "{admin_email}"        ["name"]=>        string(18) "Admin Notification"        ["event"]=>        string(15) "form_submission"        ["toType"]=>        string(5) "email"        ["subject"]=>        string(32) "New submission from {form_title}"        ["message"]=>        string(12) "{all_fields}"      }    }    ["confirmations"]=>    array(1) {      ["55a3dddb75292"]=>      array(8) {        ["id"]=>        string(13) "55a3dddb75292"        ["name"]=>        string(20) "Default Confirmation"        ["isDefault"]=>        bool(true)        ["type"]=>        string(7) "message"        ["message"]=>        string(64) "Thanks for contacting us! We will get in touch with you shortly."        ["url"]=>        string(0) ""        ["pageId"]=>        string(0) ""        ["queryString"]=>        string(0) ""      }    }    ["is_active"]=>    string(1) "1"    ["date_created"]=>    string(19) "2015-07-13 15:48:43"    ["is_trash"]=>    string(1) "0"  }}
As you can see above, the $forms variable contains an array with data on all forms within it. From here, you would be able to use that data as you need to. For example, if you wanted to display the title of the first form, you would do the following:
123
Getting a Single Form
Getting a single form is just as easy as getting all forms. Below is an example on doing so:
1234
To display the results of this, simply do the following:
1var_dump( $form );
This would show that the $form variable contains the following array:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374array(13) {  ["title"]=>  string(4) "Test"  ["description"]=>  string(0) ""  ["labelPlacement"]=>  string(9) "top_label"  ["descriptionPlacement"]=>  string(5) "below"  ["button"]=>  array(3) {    ["type"]=>    string(4) "text"    ["text"]=>    string(6) "Submit"    ["imageUrl"]=>    string(0) ""  }  ["fields"]=>  array(0) {  }  ["version"]=>  string(9) "1.9.11.15"  ["id"]=>  int(1)  ["notifications"]=>  array(1) {    ["55a3dddb74f59"]=>    array(7) {      ["id"]=>      string(13) "55a3dddb74f59"      ["to"]=>      string(13) "{admin_email}"      ["name"]=>      string(18) "Admin Notification"      ["event"]=>      string(15) "form_submission"      ["toType"]=>      string(5) "email"      ["subject"]=>      string(32) "New submission from {form_title}"      ["message"]=>      string(12) "{all_fields}"    }  }  ["confirmations"]=>  array(1) {    ["55a3dddb75292"]=>    array(8) {      ["id"]=>      string(13) "55a3dddb75292"      ["name"]=>      string(20) "Default Confirmation"      ["isDefault"]=>      bool(true)      ["type"]=>      string(7) "message"      ["message"]=>      string(64) "Thanks for contacting us! We will get in touch with you shortly."      ["url"]=>      string(0) ""      ["pageId"]=>      string(0) ""      ["queryString"]=>      string(0) ""    }  }  ["is_active"]=>  string(1) "1"  ["date_created"]=>  string(19) "2015-07-13 15:48:43"  ["is_trash"]=>  string(1) "0"}
Updating a Form
If you want to update a form, you will first need to obtain the form object for that form, make the appropriate changes, then update that form. Your code would look something like this:
12345$form_id = '1';$form = GFAPI::get_form( $form_id );$form['title'] = 'New Title';$result = GFAPI::update_form( $form );return $result;
In the example above, we are defining the ID of the form that we want to update, then getting the form object for that form. Next, we define the new title for the form. We now will take the form object that we have modified, and call GFAPI::update_form, passing the new form object which will assign the result to the $result variable. Finally, we return the result.
Getting and Manipulating Entries
In addition to obtaining and editing forms, you may also do the same with entries when using the Gravity Forms API.
Getting All Entries
1234
In the above example, we are simply getting up to 20 entries for the specified form and assigning the array to the $entry variable. If you want to display the contents of this, you may do the following:
1var_dump( $entry );
Which would then output something similar to the following:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263array(1) {  [0]=>  array(29) {    ["id"]=>    string(1) "1"    ["form_id"]=>    string(1) "1"    ["date_created"]=>    string(19) "2015-07-20 20:50:52"    ["is_starred"]=>    int(0)    ["is_read"]=>    int(0)    ["ip"]=>    string(12) "192.168.50.1"    ["source_url"]=>    string(48) "http://local.wordpress.dev/?gf_page=preview&id=1"    ["post_id"]=>    NULL    ["currency"]=>    string(3) "USD"    ["payment_status"]=>    NULL    ["payment_date"]=>    NULL    ["transaction_id"]=>    NULL    ["payment_amount"]=>    NULL    ["payment_method"]=>    NULL    ["is_fulfilled"]=>    NULL    ["created_by"]=>    string(1) "1"    ["transaction_type"]=>    NULL    ["user_agent"]=>    string(82) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0"    ["status"]=>    string(6) "active"    [1]=>    string(13) "Testing Field"    [2]=>    string(13) "Second Choice"    ["3.1"]=>    string(12) "First Choice"    ["3.3"]=>    string(12) "Third Choice"    ["4.3"]=>    string(4) "John"    ["4.6"]=>    string(3) "Doe"    ["3.2"]=>    string(0) ""    ["4.2"]=>    string(0) ""    ["4.4"]=>    string(0) ""    ["4.8"]=>    string(0) ""  }}
If you want to return more than twenty entries you would need to specify a larger page_size in the $paging parameter, see the following for more detail: GFAPI::get_entries
Getting a Single Entry
Just as it is possible to get all entries using the Gravity Forms API, you may also obtain information on a single entry.
1234
In the example above, the results are stored within the $entry entry variable. If you would like to see the object contained within it, you may run the following:
1var_dump( $entry );
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960array(29) {  ["id"]=>  string(1) "1"  ["form_id"]=>  string(1) "1"  ["date_created"]=>  string(19) "2015-07-20 20:50:52"  ["is_starred"]=>  int(0)  ["is_read"]=>  int(0)  ["ip"]=>  string(12) "192.168.50.1"  ["source_url"]=>  string(48) "http://local.wordpress.dev/?gf_page=preview&id=1"  ["post_id"]=>  NULL  ["currency"]=>  string(3) "USD"  ["payment_status"]=>  NULL  ["payment_date"]=>  NULL  ["transaction_id"]=>  NULL  ["payment_amount"]=>  NULL  ["payment_method"]=>  NULL  ["is_fulfilled"]=>  NULL  ["created_by"]=>  string(1) "1"  ["transaction_type"]=>  NULL  ["user_agent"]=>  string(82) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0"  ["status"]=>  string(6) "active"  [1]=>  string(13) "Testing Field"  [2]=>  string(13) "Second Choice"  ["3.1"]=>  string(12) "First Choice"  ["3.3"]=>  string(12) "Third Choice"  ["4.3"]=>  string(4) "John"  ["4.6"]=>  string(3) "Doe"  ["3.2"]=>  string(0) ""  ["4.2"]=>  string(0) ""  ["4.4"]=>  string(0) ""  ["4.8"]=>  string(0) ""}
From here, you can get any information that you want about the specified entry.
Update an Entry
To update an entry, you will need to first get that entry, replace your desired information, and then update it with the new information. This is done like so:
1234567
Within the code example above, we are defining the $entry_id as 1, and passing it to get_entry to get the entry with ID 1. Next, we are taking the results and modifying a part of the array. Finally, we are passing the modified array to update_entry, then returning the result.

GetResponse Feed Meta

GetResponse Feed Meta

IntroductionUsagePropertiesCustom Field Properties

Introduction
The Feed Object meta for the GetResponse add-on is an associative array containing the properties which determine how the add-on should process the form submission.
$feed['meta'] = array(
'feed_name' => 'Your Feed Name',
'feed_condition_conditional_logic' => true,
'feed_condition_conditional_logic_object' => array(
'conditionalLogic' => array(),
),
);

Usage
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
$conditional_logic_enabled = rgars( $feed, 'meta/feed_condition_conditional_logic' );

Properties

feed_name string
The feed name which appears on the add-ons feeds tab.

campaign string
The ID of the GetResponse campaign this feed will add the contact to.

fields_name string
The ID of the form field containing the contact name.

fields_email string
The ID of the form field containing the contact email.

custom_fields array
A multidimensional array containing the GetResponse custom fields. See Custom Field Properties.

feed_condition_conditional_logic boolean
Is the feed condition (conditional logic) setting enabled. Default is false.

feed_condition_conditional_logic_object array
An associative array containing the conditional logic rules. See the Conditional Logic Object for more details.

Custom Field Properties
array(
'key' => 'address_one',
'value' => '3.1',
)

Each custom field is an associative array containing the following properties:

key string
The GetResponse custom field name. Custom field names can only contain up to 32 lowercase alphanumeric characters and underscores.

value string
The ID of the form field or entry meta item containing the value for this custom field.