get_capabilities()

get_capabilities()

DescriptionUsageParametersExamplesSource Code

Description
The get_capabilities() function in the Add-On Framework retrieves all capabilities or a specific capability for the add-on.
Usage
$capabilities = get_capabilities( $capability );

Parameters

**$capability ** string
Capability to return.

Examples
This example retrieves the capability for 「gravityforms_mailchimp」
$capabilities = get_capabilities( 'gravityforms_mailchimp' );

Source Code
This function is located in the GFAddOn class in gravityforms/includes/addon/class-gf-addon.php

Obtaining Your Postmark API Keys

Obtaining Your Postmark API Keys

To use the Postmark Add-On, you』ll need to have your Postmark API keys. Postmark won』t know what account is yours without the appropriate API keys. In this article, we』ll show you how to get your Postmark API keys.

Log into your Postmark account.
Click on Account at the top of the page.
Under Account, click on the API Tokens tab.
You』ll need both an Account API token and Server API token. The Account API token is listed here, so take note of it.
To get your Server API token, start typing the name of your Postmark server in the right side search box labeled Search for server and click on the server when it appears. Then click the Get a server API token button.
A new page will load and you will be presented with your Server API token.

Now that you have your Account API and Server API tokens, you』re ready to continue setting up the Postmark Add-On or start sending form notifications using Postmark.

Setting Up the GetResponse Add-On

Setting Up the GetResponse Add-On

Pre-RequisitesGetting to your Settings PageSettingsAPI KeyAccount Type (version 1.2.1+)Next StepsAdd-on Framework HooksScreenshot

Pre-Requisites

Download and install the add-onA GetResponse account

Getting to your Settings Page

To access the add-on setting page you will need to be logged into your WordPress admin dashboard. On the left-side navigation menu, hover over Forms and click on Settings. From there, click the GetResponse tab.

Settings

Refer to screenshot at bottom.

API Key

Enter your GetResponse API Key. Your GetResponse API account information can be found by logging into your GetResponse account, going to the Integrations & API page, clicking on the API link from the left side menu, and accessing your API key information.

We support the newer v3 of the GetResponse API from add-on version 1.2.1. Earlier versions of the API are no longer supported.

Account Type (version 1.2.1+)

The GetResponse API v3 uses different endpoints for their MAX (360/Enterprise) plan. As such, you must specify the GetResponse plan you are using in order for us to direct API calls to the proper place. Choose MAX if you are on that plan, or Standard for all other plans.

When the MAX account type is selected additional settings will be displayed for the Domain (v1.2.1+) and Endpoint (v1.4.2+).

When you click Save Settings, you will be notified by a green check mark beside the API key box if all seems good. If you do not see a green check mark, double check your information and try again.

Next Steps

You will want to create a feed in order to begin sending information to your GetResponse account. Refer to this document for instructions.

Add-on Framework Hooks

Because the GetResponse Add-On is built using the Add-On Framework it also inherits any hooks available in the framework methods it uses such as:

gform_short_slug_field_value for changing a field value before it is passed to GetResponse.

Screenshot

Caption: GetResponse Add-On Settings as of version 1.2.1 and higher.???????????

GetResponse Change Log

GetResponse Change Log

1.6 | 2021-05-061.5 | 2020-09-031.4 | 2020-03-191.3 | 2020-01-221.2 | 2018-04-021.1 | 2016-08-311.0 | 2015-05-14

1.6 | 2021-05-06

Added additional logging information for update and create contact API requests.
Fixed an issue where the add-on icon is missing on the Form Settings page for Gravity Forms 2.5.
Fixed an issue where contact is not created when Preventing IP Address Storage is enabled under Personal Data settings.

1.5 | 2020-09-03

Added support for Gravity Forms 2.5.
Added the gform_getresponse_limit_pre_get_custom_fields filter allowing the maximum number of custom fields which are retrieved to be overridden.
Added support for MAX (360/Enterprise) accounts using the .pl endpoint.
Fixed an issue where values are not added to a multi_select type custom field when multiple choices are selected for the Multi Select field.

1.4 | 2020-03-19

Added translations for Hebrew, Hindi, Japanese, and Turkish.
Added the gform_getresponse_contact filter.
Fixed a PHP 7.4 notice which occur when the API is initializing and the settings are empty.

1.3 | 2020-01-22

Added support for GetResponse API version 3.
Added support for GetResponse Enterprise.
Updated labels on the add-on settings page to reflect current GetResponse account types.

1.2 | 2018-04-02

Added security enhancements.
Added GPL to plugin header.
Updated Plugin URI and Author URI to use https.
Fixed strings for translations.

1.1 | 2016-08-31

Added feed duplication support.
Added support for delaying feed processing until payment by PayPal Standard is successfully completed.
Added gf_getresponse() for easily getting a GetResponse instance.
Added Spanish (es_ES) translation.
Updated feed processing to abort if email is empty or invalid.
Fixed fatal error when GetResponse API is loaded by another plugin.

1.0 | 2015-05-14

It's all new!

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.

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.

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

Enable Use of the Total Field with Conditional Logic

Enable Use of the Total Field with Conditional Logic

IntroductionUsage LimitationsPlacementSnippetAlternatives

Introduction
The Total field is not made available to configure conditional logic rules, as it is evaluated differently to other fields. The following snippet does make it possible to use in conditional logic rules, but with the limitation that this is only appropriate for conditional logic that takes place after entry submission.
Usage Limitations
Conditional logic using the Total field is only for use on notifications, confirmations and add-on feeds. That is, features where logic is evaluated based on the saved entry.
Because the total field is always the last field to be saved you cannot use it to configure conditional logic on other fields on the form. Displaying other fields based on the total would prevent those fields being saved as the conditions would never match when the logic is evaluated, during submission.
Placement
The snippet should be placed in the functions.php file of your active theme or a custom functions plugin. You will then be able to configure less than and greater than rules based on the value of the Total field.
Snippet
class RW_GF_Total_Field_Logic {

public function __construct() {
add_action( 'init', array( $this, 'init' ) );
}

function init() {
if ( ! property_exists( 'GFForms', 'version' ) || ! version_compare( GFForms::$version, '1.9', '>=' ) ) {
return;
}

add_filter( 'gform_admin_pre_render', array( $this, 'enable_total_in_conditional_logic' ) );
}

function enable_total_in_conditional_logic( $form ) {
if ( GFCommon::is_entry_detail() ) {
return $form;
}

echo "';

return $form;
}

}
new RW_GF_Total_Field_Logic();

Alternatives
Check out our community add-on library to search for the possible options.

Enabling Conditional Logic for a Feed

Enabling Conditional Logic for a Feed

SummaryFeed SettingsExample

Summary

Conditional logic can be used to specify when a certain feed should process based on the form data. This is useful for subscribing users to mailing lists and sending payment information to different services.

Feed Settings

Enabling conditional logic for a feed can be done in the feed settings. This will need to be done for each feed associated with the form. If conditional logic is not configured, the form will process the first feed it finds.

Example

In this example we are using conditional logic to determine if the form data should be sent to one of two payment services, either Authorize.Net or Stripe.

First, we add a field to the form which allows the user to choose a payment method. We』re going to use a drop down field labeled Gateway with the choices of Authorize.Net and Stripe.

Then we create a feed for each service via the specific add on』s feed settings page. Conditional logic is enabled and the criteria is set so that the gateway equals the appropriate payment method for that feed. Click here to view a video demonstration.

When the user is on the form, they will be presented with the Gateway field which allows them to select which payment gateway they wish to use. Then when the form is submitted, the conditional logic will determine where the payment information is sent. If they select Authorize.Net as the Gateway, then the payment information will be sent to Authorize.Net. If they select Stripe as the Gateway, then the payment information will be sent to Stripe.

Enabling the Gravity Forms Toolbar Menu

Enabling the Gravity Forms Toolbar Menu

Enabling the toolbar menu itemAccessing the toolbar menu itemCapabilitiesHelp! I don』t see the toolbar!

The Gravity Forms toolbar menu enables quick access to your most recent common actions. This article shows you how to enable it.

Enabling the toolbar menu item

First, access your Gravity Forms settings page. This done by hovering over Forms on the left side admin menu, and clicking on Settings.

Once you have accessed the Settings page, locate the option labeled Toolbar Menu and turn it on.

After the Toolbar Menu option is set, save your settings by scrolling down and clicking the Save Settings button.

Accessing the toolbar menu item

After enabling the Gravity Forms toolbar menu, you should immediately see the new menu item labeled Forms. Hovering over it will provide a listing of the most recent forms accessed, as well as links to view all forms or create a new form.

By hovering over one of the forms listed, additional items will appear. From here, you can do things such as access the form editor, view entries, change settings, and preview the form.

Capabilities

Which capabilities are enabled for your user role will determine what items will appear in the menu.

Menu ItemUser Capability RequiredNew Formgravityforms_create_formAll Formsgravityforms_edit_forms

These are the submenu items for the individual forms.

Menu ItemUser Capability RequiredEditgravityforms_edit_formsEntriesgravityforms_view_entriesSettingsgravityforms_edit_formsPreviewPreview – gravityforms_edit_forms or gravityforms_create_form or gravityforms_preview_forms

See the Role Management article for more information about the plugin capabilities and how they can be managed.

Help! I don』t see the toolbar!

If you don』t see the admin toolbar at all, you may have it disabled in your main WordPress settings. To enable it, perform the following:

Access your user profile within the WordPress admin dashboard. To do so, hover over Users on the left side admin menu, and click on My Profile.Within this page, you should see an option labeled Toolbar. Ensure the checkbox is enabled. If not, enable it and save your changes.

If you still don』t see the toolbar, you may have a theme or plugin that is interfering with it. Try enabling a default theme such as Twenty Fifteen and disabling other plugins.