{$SHORT_SLUG}_feed_actions

{$SHORT_SLUG}_feed_actions

DescriptionUsageParametersPlacementSource Code

Description
The SHORT_SLUG plus 「_feed_actions」 filter in Gravity Forms adds action links to feed items. *SHORT_SLUG* is replaced with the add-on short slug.
The article Gravity Forms Add-On Slugs lists the slugs and short slugs for the available add-ons.
Usage
1add_filter( '{$SHORT_SLUG}_feed_actions', 'your_function_name' );
To run the filter for MailChimp, replace {$SHORT_SLUG} as follows.
1add_filter( 'mailchimp_feed_actions', 'your_function_name' );

Parameters

$this->_action_links array
Existing actions links on the feed item.

$item array
The feed item.

$column array
The column ID.

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in class-gf-feed-addon.php.

Translating the Datepicker

Translating the Datepicker

This work around is only necessary for Gravity Forms versions 2.4 and prior. The datepicker translations are part of the standard translation package in Gravity Forms 2.5.
The Datepicker used by the Date field is powered by the jQuery UI Datepicker script which is bundled with WordPress, as such it won』t be translated by the translation files included with Gravity Forms.
To translate the Datepicker you will need to download the translation file for your desired language from the jQuery UI GitHub repository. Save the file to the /js/ directory of your active theme.
Next you would add the following code snippet to your theme functions.php file, updating datepicker-your-lang with the actual name of the translation file you downloaded.
1234567add_action( 'gform_enqueue_scripts', 'add_datepicker_regional', 11 );function add_datepicker_regional() {    if ( wp_script_is( 'gform_datepicker_init' ) ) {        wp_enqueue_script( 'datepicker-regional', get_stylesheet_directory_uri() . '/js/datepicker-your-lang.js', array( 'gform_datepicker_init' ), false, true );        remove_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );    }}

Submit Button CSS Selectors

Submit Button CSS Selectors

Basic TargetingSubmit ButtonSubmit Button (image)Use Case ExamplesBasic ExampleHover ExampleActive State ExampleInline Positioning Of The Submit Button

Here』s how to apply styles to Gravity Forms submit buttons. You can utilize these selectors to apply any additional styling that you may need.
Basic Targeting
Submit Button

example: the form submit button (input) – applies to all forms
body .gform_wrapper .gform_footer input[type=submit] {border: 1px solid red}

example: the form submit button (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_footer input[type=submit] {border: 1px solid red}

Submit Button (image)

example: the form submit button (image) – applies to all forms
body .gform_wrapper .gform_footer input[type=image] {border: 1px solid red}

example: the form submit button (image) – applies just to form ID #1
body #gform_wrapper_1 .gform_footer input[type=image] {border: 1px solid red}

Use Case Examples
Basic Example
body .gform_wrapper .gform_footer input.button,
body .gform_wrapper .gform_footer input[type=submit] {
color:#ffffff;
padding-top:4px;
padding-bottom:4px;
padding-left:10px;
padding-right:10px;
border: 1px solid rgba(114,114,114,0.4);
border-radius: 1px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
box-shadow: 0 1px 0px rgba(114,114,114,0.3);
-moz-box-shadow: 0 1px 0px rgba(114,114,114,0.3);
-webkit-box-shadow: 0 1px 0px rgba(114,114,114,0.3);
background-color: #0096d6;
}

Hover Example
body .gform_wrapper .gform_footer input[type=submit]:hover {
border: 1px solid rgba(114,114,114,0.6);
background-color: #444444;
}

Active State Example
body .gform_wrapper .gform_footer input[type=submit]:active {
top: 1px;
}

Inline Positioning Of The Submit Button
/* make the form container relative for positioning */

body #gform_wrapper_1 {
position: relative;
}

/* resize and position the form footer with the button */

body #gform_wrapper_1 .gform_footer {
width: auto;
position: absolute;
top: 46px;
left: 150px;
padding: 0;
margin: 0;
}

Signature

Signature

SummaryCommon SettingsAppearance SettingsEntry DetailsMerge TagsRelated Filters

Summary

The Signature field for Gravity Forms allows you to capture signatures online by allowing users to sign your forms using touchscreen devices, touch pads or mouse. It is available under the Advanced Fields section within the form editor.

Signature field as displayed in the Field Library

Signature field as displayed in the Form Editor.

Common Settings

For a description of each of the common field settings, refer to this article. Below you will find descriptions of specialty settings that are particular to this field.

Appearance Settings

SettingDescriptionBackground ColorSelect the background color of the Signature field.Border ColorSelect the border color of the Signature field.Border WidthSelect the border width of the Signature field from a dropdown.Border StyleSelect the border style of the Signature field from a dropdown.Pen ColorSelect the pen color of the Signature field.Pen SizeSelect the pen size of the Signature field from a dropdown.Field WidthSelect the field width of the Signature field.

Entry Details

When you view the Entry Details for a Form Entry that contains a Signature field, you will see the signature included in the entry details. The signature will be presented as a thumbnail image and you can click on the thumbnail to see the full size version of the signature itself.

Merge Tags

For security reasons it is not automatically included as part of the {all_fields} merge tag output. You can include signatures in your email notifications by inserting the merge tag for your Signature field in the message of your notification.

Related Filters

The following filter was added to Gravity Forms in support of the signature field:

gform_signature_show_in_all_fields

The simple_condition Helper

The simple_condition Helper

IntroductionInclude the custom settingDefine custom_logic_type field markupPopulate the fields drop downEvaluate the rules

Introduction
When using the Settings API there may be times when you need a field type which allows the user to define a simple conditional logic rule, that』s where the simple_condition() function helps.

Include the custom setting
Because there isn』t an actual simple_condition field type you would need to create your own Custom Field Type. In this example our custom field type will be named custom_logic_type, it is defined in the settings fields array like so:
12345array(    'label' => esc_html__( 'Simple condition', 'simpleaddon' ),    'type'  => 'custom_logic_type',    'name'  => 'custom_logic',),
Define custom_logic_type field markup
Now the setting has been included we need to define the markup for the custom_logic_type field type so it can be displayed on the settings page.
Because we don』t want the simple condition settings to be used all the time we will add a checkbox which can be used to enable/disable them. An onlclick event will be added to the checkbox to show/hide the div containing the simple condition settings.
1234567891011121314151617181920212223242526272829303132public function settings_custom_logic_type( $field, $echo = true ) {     // Get the setting name.    $name = $field['name'];     // Define the properties for the checkbox to be used to enable/disable access to the simple condition settings.    $checkbox_field = array(        'name'    => $name,        'type'    => 'checkbox',        'choices' => array(            array(                'label' => esc_html__( 'Enabled', 'simpleaddon' ),                'name'  => $name . '_enabled',            ),        ),        'onclick' => "if(this.checked){jQuery('#{$name}_condition_container').show();} else{jQuery('#{$name}_condition_container').hide();}",    );     // Determine if the checkbox is checked, if not the simple condition settings should be hidden.    $is_enabled      = $this->get_setting( $name . '_enabled' ) == '1';    $container_style = ! $is_enabled ? "style='display:none;'" : '';     // Put together the field markup.    $str = sprintf( "%s

%s

",        $this->settings_checkbox( $checkbox_field, false ),        $name,        $container_style,        $this->simple_condition( $name )    );     echo $str;}
Populate the fields drop down
We need to define which fields are to be available for selection in the simple condition settings fields drop down.
123456789101112131415161718192021222324252627282930313233public function get_conditional_logic_fields() {    $form   = $this->get_current_form();    $fields = array();    foreach ( $form['fields'] as $field ) {        if ( $field->is_conditional_logic_supported() ) {            $inputs = $field->get_entry_inputs();             if ( $inputs ) {                $choices = array();                 foreach ( $inputs as $input ) {                    if ( rgar( $input, 'isHidden' ) ) {                        continue;                    }                    $choices[] = array(                        'value' => $input['id'],                        'label' => GFCommon::get_label( $field, $input['id'], true )                    );                }                 if ( ! empty( $choices ) ) {                    $fields[] = array( 'choices' => $choices, 'label' => GFCommon::get_label( $field ) );                }             } else {                $fields[] = array( 'value' => $field->id, 'label' => GFCommon::get_label( $field ) );            }         }    }     return $fields;}
Evaluate the rules
To evaluate the rules the user configured for the custom_logic setting we will need to create a custom helper function. In this example the setting is being used on a form settings page so we need to retrieve them from the form settings. If the settings are being used on a feed settings page you would need to retrieve them from the $feed[『meta』].
1234567891011121314151617181920212223242526public function is_custom_logic_met( $form, $entry ) {    $settings = $this->get_form_settings( $form );     $name       = 'custom_logic';    $is_enabled = rgar( $settings, $name . '_enabled' );     if ( ! $is_enabled ) {        // The setting is not enabled so we handle it as if the rules are met.         return true;    }     // Build the logic array to be used by Gravity Forms when evaluating the rules.    $logic = array(        'logicType' => 'all',        'rules'     => array(            array(                'fieldId'  => rgar( $settings, $name . '_field_id' ),                'operator' => rgar( $settings, $name . '_operator' ),                'value'    => rgar( $settings, $name . '_value' ),            ),        )    );     return GFCommon::evaluate_conditional_logic( $logic, $form, $entry );}
This helper can then be used wherever you need to evaluate the rules, in the sample add-on available on GitHub the helper is used to determine if a custom action should be performed at the end of the form submission process.
123456789public function after_submission( $entry, $form ) {     // Evaluate the rules configured for the custom_logic setting.    $result = $this->is_custom_logic_met( $form, $entry );     if ( $result ) {        // Do something awesome because the rules were met.    }}

Stripe Feed Meta

Stripe Feed Meta

IntroductionUsagePropertiesProduct Transaction PropertiesSubscription Transaction Properties

Introduction
The Feed Object meta for the Stripe add-on is an associative array containing the properties which determine what type of transaction should occur and what values are sent to Stripe.
12345678910$feed['meta'] = array(    'feedName'                       => 'Your Feed Name',    'transactionType'                   => 'product',    'paymentAmount'                   => 'form_total',    'receipt_field'                      => '3',    '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.:
1$conditional_logic_enabled = rgars( $feed, 'meta/feed_condition_conditional_logic' );

Properties

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

transactionType string
The type of transaction which should occur when the feed is processed. Possible values: product or subscription.

metaData array
An indexed array of custom meta information. Stripe allows a maximum of 20 custom keys to be sent. Each custom meta array contains the following properties.
12345array(    'key'        => 'gf_custom',    'value'      => '1.3',    'custom_key' => 'product_quantity',);

key string
Value should be gf_custom. Instructs the dynamic_field_map setting to use the custom_key input.

value string
The ID of the field containing the value to be sent for the specified custom_key. The mapped data will be truncated to 500 characters per requirements by Stripe.

custom_key string
The custom key you want to use when sending the custom metadata to Stripe. Must be 40 characters or less.

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.

Product Transaction Properties
The following properties are only applicable when the transactionType is set to product.

paymentAmount string
What to use for the payment amount. Possible values: form_total or a product field ID.

receipt_field string
The ID of the field containing the email Stripe should use when sending their receipt.

Subscription Transaction Properties
The following properties are only applicable when the transactionType is set to subscription.

recurringAmount string
What to use for the recurring amount. Possible values: form_total or a product field ID

billingCycle_length integer
How often should the recurring payment occur. Maximum values: 1 year or 12 weeks or 12 months.

billingCycle_unit string
How often should the recurring payment occur. Possible values: week, month or year.

setupFee_enabled boolean
Should a setup fee be charged? Default is false.

setupFee_product string
The ID of the product field containing the amount the user should be charged for the setup fee.

trial_enabled boolean
Should the recurring charge occur immediately or after a trial period? Default false.

trialPeriod integer
The number of days the trial period should last.

customerInformation_email string
The ID of the field containing the customer email.

customerInformation_description string
The ID of the field containing the customer description.

Taking a Screenshot of Your Feed Settings

Taking a Screenshot of Your Feed Settings

IntroductionNavigate To your Feed SettingsTaking A Screenshot

Introduction

Sometimes when requesting technical support, our Support Engineers (or the ticket form) may request a screenshot of your feed settings.

This small guide gives a little advice on taking a good screenshot.

Navigate To your Feed Settings

The feed settings we are interested in can be accessed by clicking the Settings button at the top of the form editor page.

Navigate to the form in question.Click or hover over Settings at top. Scroll down and choose the add-on you need help with. You will be presented with a screens showing a list of feeds for that add-on.Click Edit on the feed you need help with.

This will place you on the feed settings screen we need.

Taking A Screenshot

Most operating systems have some screenshot taking functionality built in. Here』s some help for the most popular OSs:

Mac → support articleWindows → help guide

Alternatively, there are dozens of good third party screenshot taking apps available in your application marketplace. Here』s one many that many of our Mac using team members love: https://cleanshot.com/

Make sure to include field mappings, options, and conditional logic in the image. Sometimes the feed settings are too large to get a single screenshot of it all. If your screenshot software cannot support full page screenshots, then zoom out the view of your browser first. CMD – (command key and minus/dash key) on MacOS or CTRL – (command key and minus/dash key) on Windows. You can also take multiple screenshots if it is clearer.

Now you should have something to send us. A good screenshot can really get Support Team excited!

Fighting Spam

Fighting Spam

IntroductionSolutionsHoneypotCaptchaSubmit Button Conditional LogicMulti-Page FormsBlock Search IndexingPluginsField ValidationSpam BlockersBlock by IPCloudflareCode SnippetsField ValidationSpam Filter

Introduction

Spam is a problem which impacts all publicly accessible forms and fighting it is complicated by the fact that spammers and bots are constantly evolving their methods. The good news is there are a number of solutions you can use to reduce the amount of spam which is successfully submitted. But note that there』s not any single anti-spam method in the world able to catch 100% of spam, because of that you can find hundreds of different anti-spam techniques and services, therefore for better results we recommend using multiple solutions at the same time.

Solutions

Honeypot

Gravity Forms includes a built-in honeypot feature which can be enabled on the Form Settings page of each form. When enabled the form will include a field which is hidden from visitors but is visible to bots. If this field contains a value when the form is submitted the submission will be ignored; the entry is not saved, notifications, and add-ons are not processed.

The gform_honeypot_labels_pre_render filter can be used to change the labels used by the honeypot field.

If HTML5 is enabled on the Forms > Settings page the autocomplete='off' attribute will be added to the input, which should help prevent the input being filled by browsers.

Captcha

Our reCAPTCHA Add-On adds Google reCAPTCHA v3 functionality into your toolbox. Refer to documentation here.

The built-in Captcha field is another method to reduce spam from bots although it can introduce accessibility issues. This integrates Google』s reCAPTCHA version 2.

Submit Button Conditional Logic

Add a single line text field to your form which asks a simple question. A real person should be able to answer the question correctly whereas most bots won』t.

Here are some examples:

A panda is black and _____4 + 7 = _____What goes up, must come _____A cow has how many legs? _____

On the Form Settings page of the form you would enable button conditional logic based on this question field. If the submitter doesn』t input the correct answer the form can』t submit.

Multi-Page Forms

If you will be accepting payments using a card or payment add-on field position it on the last page of the form. Enabling the required setting on a number of fields located on earlier pages can help ensure the card/payment add-on field is only used by those who have successfully completed the earlier pages in the form, reducing the chances of your form being used for fraudulent carding activity.

Block Search Indexing

Preventing search engines from indexing the page containing the form can help prevent your form being targeted by bots and spammers.

Google recommends using the noindex directive but if the page is already indexed you』ll also need to remove it via webmaster tools.

Plugins

Gravity Forms includes built-in support for the Akismet Anti-Spam plugin by Automattic. We also have an Akismet Add-On which enhances the integration with form level settings to help improve the quality of the data sent to Akismet for evaluation.

The following add-ons are from certified developers:

Gravity Perks Blocklist by Gravity Wiz can be used to validate submissions against the WordPress Disallowed Comment Keys. Disallowed Comment Keys was previously known as Comment Blocklist (WordPress 5.4) and Comment Blacklist (WordPress 5.3 and earlier).Gravity Perks Limit Submissions by Gravity Wiz can be used to limit the number of entries that can be submitted by almost anything (user, role, IP, URL, field value) for almost any time period.Gravity Forms Zero Spam by GravityView uses JavaScript to append a custom input to the form; if the input is not found in the submission or value does not match the expected value the submission is marked as spam.

The following third-party plugins also offer integrations with Gravity Forms. Any listing here is not a recommendation or endorsement of fitness for any purpose.

Field Validation

BSK Forms Blacklist by BannerSky.comGravity Forms Block Email Domains by Road Warrior CreativeGravity Forms Email Blacklist by hallmeG-Forms hCaptcha by Web & App Easy B.V is an alternative to reCaptcha.Byteplant Email Validator by byteplant.com enhances validation of Email type fields.Byteplant Phone Validator by byteplant.com enhances validation of Phone type fields.Dilli Email Validator by Dilli Labs LLC enhances validation of Email type fields.

Spam Blockers

Toolbelt by Ben GillbanksAnti-Spam by CleanTalkCerber Security, Antispam & Malware ScanWPBruiser + Gravity Forms ExtensionHuman Presence by Human Presence Technology

Block by IP

Block IPs for Gravity Forms by Team Bright Vessel

Cloudflare

Cloudflare offers a number of services which can protect your site (and forms) such as IP Access Rules that would allow you to even block entire countries easily, DDoS Protection, WAF, Bot Management, Rate Limiting, SSL/TLS, and DNSSEC to name just a few.

Code Snippets

Code snippets can be used in the theme functions.php file or custom functionality plugins.

Field Validation

The gform_field_validation and/or gform_validation filters can be used to perform custom validation of field values.

Integrate with QuickEmailVerification API

Spam Filter

The gform_entry_is_spam filter can be used to mark submissions as spam.

Integrate with OOPSpam Anti-SpamIntegrate with the Plino spam filtering serviceIntegrate with the ZeroBounce Email Validation APICheck field values for URLsRate limit submissions based on the IP addressCheck that first and last name inputs contain different valuesUse ipapi.co to check country code for IP addressGravity Forms and Disallowed Keys by Ipstenu (Mika Epstein)

Recurring Payment Account Detail and Credit Card Changes

Recurring Payment Account Detail and Credit Card Changes

Currently it is not possible to change any account details within recurring payments when using Authorize.Net. To make changes to a recurring payment, you will need to cancel the subscription, then create a new subscription with the changed information.
If you require more information on canceling a subscription, take a look at our article on recurring subscription cancelations.

Single Line Text Field CSS Selectors

Single Line Text Field CSS Selectors

ContainerInputMaximum Characters Counter

Container

example: single line text field container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_text {border: 1px solid red}

example: single line text field container (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_text {border: 1px solid red}

example: single line text field container (div) – applies just to specific indicator (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_text {border: 1px solid red}

Input

example: standard text field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_text input[type=text] {border: 1px solid red}

example: standard text field (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_text input[type=text] {border: 1px solid red}

example: standard text field (input) – applies just to specific text field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_text input[type=text] {border: 1px solid red}

Maximum Characters Counter

example: standard text field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_text .charleft {border: 1px solid red}

example: standard text field (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_text .charleft {border: 1px solid red}

example: standard text field (input) – applies just to specific text field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_text .charleft {border: 1px solid red}