Advanced Post Creation Add-On Using Third-Party Post Types

Advanced Post Creation Add-On Using Third-Party Post Types

IntroductionCreating Products for WooCommerceCreate the FormCreate the Advanced Post Creation FeedHandling Fields Unable to be MappedPriceCategoryPopulating Drop Down with Product CategoriesCreating Events for The Events CalendarCreate the FormCreate the Advanced Post Creation FeedHandling Fields Unable to be MappedPopulating Drop Down with Event CategoriesMatching up Images with Advanced Custom Fields (ACF) or other Custom FieldsMake sure the Field is copied to the Media LibraryMap the Image Field to the Custom Field

Introduction

One of the features of the Advanced Post Creation Add-On allows posts to be created upon form submission for third-party post types. This articles provides a guide on how to use Advanced Post Creation with the plugins WooCommerce, to create Products, and The Events Calendar, to create Events.

Note: This article assumes you have installed and activated the required plugins. If not, you will need to do so before any of the functionality in this article can be used.

Creating Products for WooCommerce

Create the Form

Several pieces of information need to be captured to create a Product. Below captures some basic information.

Field TypeLabelOther SettingsDrop DownCategorySee Populating Drop Down with Product Categories below for details.Single Line TextProduct Name ParagraphDescription NumberPriceSet the number format to currencyFile UploadProduct Image 

Create the Advanced Post Creation Feed

For more details about how to create the feed, review the Creating A Feed For The Advanced Post Creation Add-On article.

Expand the drop down for Type in the Post Settings section and select Product.

Scroll to the Post Content section and map the Title to the Product Name field.Map the Content to the Description field.Map the Featured Image to a File Upload field labeled Image. If the File Upload field is not present on your form this field will not appear in Post Creation settings.

Click Save Settings.

Note: The Price and Category will be handled separately because they cannot be directly mapped.

Handling Fields Unable to be Mapped

Not all fields needed for the product can directly be mapped in the feed. The gform_advancedpostcreation_post_after_creation action hook will be used to update the Price and Category for the product. Below are examples for two of the Product fields which need to be handled specially.

For more details about the hook parameters, placement, and usage, see the article mentioned above.

Price

The price information is stored in the wp_post_meta table and the update_post_meta() function will be used to save this information.

Category

The product category utilizes multiple WordPress taxonomy and term database tables and the wp_set_object_terms() function will be used to save this information.

The example below updates the Price using the value stored in field 7 of the entry. The Category is updated using the value stored in field 6 of the entry.

add_action( 'gform_advancedpostcreation_post_after_creation', 'update_product_information', 10, 4 );
function update_product_information( $post_id, $feed, $entry, $form ){

//update the prices set for the product
update_post_meta( $post_id, '_regular_price', $entry['7'] );
update_post_meta( $post_id, '_price', $entry['7'] );

//update the category
wp_set_object_terms( $post_id, $entry['6'], 'product_cat' );

}

Populating Drop Down with Product Categories

Note: This example expects the product categories to not have children. If there are child categories, the example will need to be modified as needed.

Several filters are needed to populate the drop down. The article Dynamically Populating Drop Down Or Radio Buttons Fields has more information. The filters used are:

gform_pre_rendergform_pre_submission_filtergform_admin_pre_rendergform_pre_validation

add_filter( 'gform_pre_render_83', 'populate_dropdown_with_product_categories' );
add_filter( 'gform_pre_submission_filter_83', 'populate_dropdown_with_product_categories' );
add_filter( 'gform_admin_pre_render_83', 'populate_dropdown_with_product_categories' );
add_filter( 'gform_pre_validation_83', 'populate_dropdown_with_product_categories' );
function populate_dropdown_with_product_categories( $form ) {
//product_cat is the taxonomy for WooCommerce's products
//get the terms for the product_cat taxonomy
$product_categories = get_terms( 'product_cat' );

//Creating drop down item array.
$items = array();

//Adding initial blank value.
$items[] = array( 'text' => '', 'value' => '' );

//Adding product category terms to the items array
foreach ( $product_categories as $product_category ) {
$items[] = array( 'value' => $product_category->name, 'text' => $product_category->name );
}

//Adding items to field id 6. Replace 6 with your actual field id. You can get the field id by looking at the input name in the markup.
foreach ( $form['fields'] as &$field ) {
if ( $field->id == 6 ) {
$field->choices = $items;
}
}

return $form;
}

Creating Events for The Events Calendar

Create the Form

Several pieces of information need to be captured to create an Event. Below captures some basic information.

Create a new form and add the following fields.

TypeLabelOther SettingsDrop DownCategorySee Populating Drop Down with Event Categories below for details.Single Line TextEvent Title ParagraphEvent Description CheckboxesEvent OptionsChoices: All Day, Hide From Event Listings, Sticky in Month View, Feature EventDateStart Date TimeStart TimeConditional Logic: Show field if Event Options is not All DayDateEnd Date TimeEnd TimeConditional Logic: Show field if Event Options is not All Day

Create the Advanced Post Creation Feed

For more details about how to create the feed, review the Creating A Feed For The Advanced Post Creation Add-On article.

Expand the drop down for Type in the Post Settings section and select Event.

Scroll to the Post Content section and map the Title to the Event Title field.Map the Content to the Event Description field.Scroll to the Taxonomies section and map the Event Categories to Field Value and Category field.

Click Save Settings.

Handling Fields Unable to be Mapped

Not all fields needed for the event can directly be mapped in the feed. The gform_advancedpostcreation_post_after_creation action hook will be used to update these fields. Below are examples for several fields which need to be handled specially.

For more details about the hook parameters, placement, and usage, see the article mentioned above.

add_action( 'gform_advancedpostcreation_post_after_creation', 'update_event_information', 10, 4 );
function update_event_information( $post_id, $feed, $entry, $form ){
//update the All Day setting
$all_day = $entry['9.1'];
if ( $all_day == 'All Day' ){
update_post_meta( $post_id, '_EventAllDay', 'yes');
}

//update the Hide From Monthly View Setting
$hide = $entry['9.2'];
if ( $hide == 'Hide From Event Listings') {
update_post_meta( $post_id, '_EventHideFromUpcoming', 'yes' );
}

//update the Sticky in Month View setting
$sticky = $entry['9.3'];
if ( $sticky == 'Sticky in Month View' ){
wp_update_post(array( 'ID' => $post_id, 'menu_order' => '-1' ) );
}
else{
wp_update_post(array( 'ID' => $post_id, 'menu_order' => '0' ) );
}

//update the Feature Event setting
$feature = $entry['9.4'];
if ( $feature == 'Feature Event'){
update_post_meta( $post_id, '_tribe_featured', '1');
}
else{
update_post_meta( $post_id, '_tribe_featured', '0');
}
}

Populating Drop Down with Event Categories

Several filters are needed to populate the drop down. The article Dynamically Populating Drop Down Or Radio Buttons Fields has more information. The filters used are:

gform_pre_rendergform_pre_submission_filtergform_admin_pre_rendergform_pre_validation

//target form 80 (change to your form id)
add_filter( 'gform_pre_render_80', 'populate_dropdown_with_event_categories' );
add_filter( 'gform_pre_submission_filter_80', 'populate_dropdown_with_event_categories' );
add_filter( 'gform_admin_pre_render_80', 'populate_dropdown_with_event_categories' );
add_filter( 'gform_pre_validation_80', 'populate_dropdown_with_event_categories' );
function populate_dropdown_with_event_categories( $form ) {

$event_categories = get_terms( array('taxonomy'=>'tribe_events_cat','hide_empty'=>0 ) );
//Creating drop down item array.
$items = array();

//Adding initial blank value.
$items[] = array( 'text' => '', 'value' => '' );

//Adding product category terms to the items array
foreach ( $event_categories as $event_category ) {
$items[] = array( 'value' => $event_category->name, 'text' => $event_category->name );
}

//Adding items to field id 10. Replace 10 with your actual field id. You can get the field id by looking at the input name in the markup.
foreach ( $form['fields'] as &$field ) {
if ( $field->id == 10 ) {
$field->choices = $items;
}
}

return $form;
}

Matching up Images with Advanced Custom Fields (ACF) or other Custom Fields

When images are stored to Custom Fields, they are written into Custom Post Meta with a value of the ID (or an array of id』s) that link to the Image in the Media Library. In order to properly map an Image Custom Field to an Upload Field added from Gravity Forms, you need to use the {apc_media} merge tag in the Custom Field Mapping for the Advanced Post Creation Feed.

Make sure the Field is copied to the Media Library

The file will not be available to be mapped properly to the Custom Meta if you don』t also copy that file to the Media Library. As long as you have added your image field as a File Upload Field, it will be available to copy the field to the Media Library. This will make sure that the field has a Post ID that is the 『Image ID』 in ACF and other Custom Field plugins.

Map the Image Field to the Custom Field

You will need to perform this step for each image field you』re adding.

Under Custom Fields, Add a field mapping for your Image field. Select the 『name』 of the field under Name.Under Value, Select 「Add a Custom Value」Use the Merge Tag Tool to select your Image Field to place it』s merge tag in the ValueReplace the 「Field Name」 in the Merge tag with the apc_media merge tag actionAdd ids or urls as the return type to the end of your image tag

ActiveCampaign Feed Meta

ActiveCampaign Feed Meta

IntroductionUsagePropertiesCustom Field Properties

Introduction
The Feed Object meta for the ActiveCampaign 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',
'fields_email' => '1',
'fields_first_name' => '2.3',
'fields_last_name' => '2.6',
'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.

list string
The ID of the ActiveCampaign List this feed will subscribe the user to when processed.

fields_email string
The ID of the field containing the user』s email address. Required.

fields_first_name string
The ID of the field containing the user』s first name.

fields_last_name string
The ID of the field containing the user』s last name.

fields_phone string
The ID of the field containing the user』s phone number.

fields_orgname string
The ID of the field containing the user』s organization name.

fields_tags string
The ID of the field containing the tags. This setting was removed in ActiveCampaign 1.2.

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

tags string
A comma seperated list of tags. Merge tags are supported. This setting was added in ActiveCampaign 1.2.

double_optin_form string
The ID of the ActiveCampaign form which will be used when exporting to ActiveCampaign to send the opt-in email.

instant_responders boolean
Should ActiveCampaign send any instant responders setup when the contact is added to the list. This option is not available to users on a free trial. Default is false.

last_message boolean
Should ActiveCampaign send the last campaign sent out to the list to the contact being added. This option is not available to users on a free trial. Default is false.

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' => '1',
'value' => 'date_created',
)

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

key integer
The ActiveCampaign custom field ID.

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

Address Field CSS Selectors

Address Field CSS Selectors

Address Line 1ContainerInputLabelAddress Line 2ContainerInputLabelCityContainerInputLabelStateContainerInputLabelZip CodeContainerInputLabelCountryContainerInputLabel

Address Line 1
Container
example: address – address line 1 container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_1 {border: 1px solid red;}
example: address – address line 1 container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_1 {border: 1px solid red;}
example: address – address line 1 container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_1 {border: 1px solid red;}
Input
example: address – address line 1 field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_1 input {border: 1px solid red;}
example: address – address line 1 field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_1 input {border: 1px solid red;}
example: address – address line 1 field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_1 input {border: 1px solid red;}
Label
example: address – address line 1 sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_1 label {color: red;}
example: address – address line 1 sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_1 label {color: red;}
example: address – address line 1 sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_1 label {color: red;}
Address Line 2
Container
example: address – address line 2 container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_2 {border: 1px solid red;}
example: address – address line 2 container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_2 {border: 1px solid red;}
example: address – address line 2 container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_2 {border: 1px solid red;}
Input
example: address – address line 2 field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_2 input {border: 1px solid red;}
example: address – address line 2 field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_2 input {border: 1px solid red;}
example: address – address line 2 field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_2 input {border: 1px solid red;}
Label
example: address – address line 2 sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_line_2 label {color: red;}
example: address – address line 2 sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_line_2 label {color: red;}
example: address – address line 2 sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_line_2 label {color: red;}
City
Container
example: address – city container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_city {border: 1px solid red;}
example: address – city container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_city {border: 1px solid red;}
example: address – city container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_city {border: 1px solid red;}
Input
example: address – city field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_city input {border: 1px solid red;}
example: address – city field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_city input {border: 1px solid red;}
example: address – city field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_city input {border: 1px solid red;}
Label
example: address – city sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_city label {color: red;}
example: address – city sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_city label {color: red;}
example: address – city sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_city label {color: red;}
State
Container
example: address – state container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_state {border: 1px solid red;}
example: address – state container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_state {border: 1px solid red;}
example: address – state container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_state {border: 1px solid red;}
Input
example: address – state field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_state input {border: 1px solid red;}
example: address – state field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_state input {border: 1px solid red;}
example: address – state field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_state input {border: 1px solid red;}
Label
example: address – state sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_state label {color: red;}
example: address – state sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_state label {color: red;}
example: address – state sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_state label {color: red;}
Zip Code
Container
example: address – zip container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_zip {border: 1px solid red;}
example: address – zip container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_zip {border: 1px solid red;}
example: address – zip container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_zip {border: 1px solid red;}
Input
example: address – zip field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_zip input {border: 1px solid red;}
example: address – zip field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_zip input {border: 1px solid red;}
example: address – zip field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_zip input {border: 1px solid red;}
Label
example: address – zip sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_zip label {color: red;}
example: address – zip sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_zip label {color: red;}
example: address – zip sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_zip label {color: red;}
Country
Container
example: address – country container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_country {border: 1px solid red;}
example: address – country container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_country {border: 1px solid red;}
example: address – country container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_country {border: 1px solid red;}
Input
example: address – country field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_country select {border: 1px solid red;}
example: address – country field (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_country select {border: 1px solid red;}
example: address – country field (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_country select {border: 1px solid red;}
Label
example: address – country sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .address_country label {color: red;}
example: address – country sub-label (label) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield .address_country label {color: red;}
example: address – country sub-label (label) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield .address_country label {color: red;}

Accessibility Guide for Designers

Accessibility Guide for Designers

IntroUse a visible labelThe order of elementsColour contrast of form controlsDesign clear hover and focus statesMake it easily clickable!Custom styled controls can be hardFont sizeAdditional Resources:

Intro
Design a beautiful form and and make it accessible for all users, that』s what we all want. What do you need to take into account? On this page we list some of the most important topics where design, accessibility and good UX meet.
We suggest you first read the document for Accessibility for Content Providers, as a lot of that information is also relevant to designers.
Use a visible label
As highlighted in the documentation for content providers, it is worth emphasizing again here: a visible label is required for an accessible website.

It reminds the user about what to fill out.
If the form is filled with values via autofill, the user can check easily if the information is filled out correctly.
Give the user all the help you can offer to fill out a form.

The order of elements
Visitors, and especially people using a screen reader, read from the top down. So the order of the information must be logical if you read it from the top down.
 For example information placed below the submit button could stay unnoticed. Place the label above or next to the form control, not below it. A label below an input field can confuse users about which label belongs to which input field.
Colour contrast of form controls
A form control, like an input field should be recognisable. Don』t make your visitor guess where an input fields is. People are used to conventions, so no need to reinvent the wheel for an important element such as a form field, as to many breaks from generally understood conventions may introduce difficulties for some of your customers.
Give a form control like an input field clear borders, with a colour contrast of 3:1 between the control and the background.
Design clear hover and focus states
Let users clearly see the on hover or on focus states for focusable elements like buttons, input fields and links. Keyboard only users need to know when an element has focus, or else they can be easily lost on a page. Make sure the state change is not just based on a color change, as color blind people may miss that change.
Make it easily clickable!
Very small buttons are harder to target with a mouse or a finger. Make focusable elements like buttons or selects, stand out. Give them room, and make them large enough to be easily clicked.
Custom styled controls can be hard
Consult your developer when you apply complex custom styling to select fields and your options, checkboxes and radio buttons. Some styling is very hard to make accessible, and a compromise may be the best way to go.
Font size
Avoid small font sizes: stick with 16px or larger wherever possible, then everyone can read the text comfortably.
Additional Resources:

Jesse Hausler: 7 Things Every Designer Needs to Know about Accessibility
Tyler Hawkins: Designing accessible forms: the 10 foundational rules
Human Made: Accessible Design: A Process
WebAIM: Creating Accessible Forms – General Form Accessibility

Adding a Form Using the Classic Editor

Adding a Form Using the Classic Editor

SummaryPage/Post EditorAdd Form ButtonAdd Code Manually Using a Shortcode

Summary
In this article, we show how to add a form to a page or post using the classic editor.
Page/Post Editor
Add Form Button
From the Page or Post Editor, click the Add Form button in the Upload/Insert toolbar. This is located to the left of the Visual/Text tabs in the body text editor.
Clicking the Add Form button will activate the Insert A Form modal window.Select a form from the Select a Form dropdown. If you are unable to find your form in the dropdown list, return to the Edit Forms page and ensure that your form is active.
Once you have selected a form, you can specify the following options:

Display form title
Checking this option will display the form title.
Display form description
Checking this option will display the form description.
Enable AJAX
Checking this option will enable your form to be submitted via AJAX. Submitting the form via AJAX allows the form to be submitted without requiring a page refresh. Note: Due to limitations with reCAPTCHA, forms containing a reCAPTCHA field will not be submitted via AJAX even if this option is enabled.
Tabindex
Located under Advanced Options, this lets you specify the starting tab index for the fields of this form.

After you have specified your desired options, click the Insert Form button to automatically insert the Gravity Forms shortcode into the body of the page/post content you are editing. Don』t forget to save the changes!
Add Code Manually Using a Shortcode
If you would like to build the WordPress shortcode manually, then insert the shortcode into the body of the page or post you would like the form to appear in.
See this article for more information on form shortcodes.

2Checkout Field

2Checkout Field

Pre-RequisitesSummaryNotes

Pre-Requisites

This field is only available in the Form Editor if you have installed the official Gravity Forms 2Checkout Add-On

Summary

The 2Checkout field provides Credit Card input fields tied to integrating with the 2Checkout payment service. If you have another Payment Gateway add-on installed and active, the Gravity Forms Credit Card Field is still available in case you are allowing users to choose from a list of payment processors, such as Stripe and Authorize.Net (the standard Credit Card field is needed for Authorize.Net』s processing). Conditional logic can be used to show/hide the Credit Card field depending on the payment processor selection.

2Checkout field as displayed in the Field Library

2Checkout field as displayed in the Form Editor.

This field will add the Credit Card Detail inputs for 2Checkout. The Card Details input collects the Card Number, Expiration Date, Security Code, and Cardholder Name. This part of the 2Checkout field is hosted on 2Checkout』s servers. All fields are required and are passed onto 2Checkout. You can modify the Field Label and the Description for this field.

Notes

When using Page fields to create a multi-page form, the 2Checkout field should be located on the last page of the form.

Advanced Post Creation Change Log

Advanced Post Creation Change Log

1.11.0 | 2021-07-211.0-beta-7.51.0-beta-7.41.0-beta-7.31.0-beta-7.21.0-beta-7.11.0-beta-7 | 2020-09-281.0-beta-6 | 2020-09-241.0-beta-5 | 2020-08-051.0-beta-4 | 2020-05-071.0-beta-3 | 2019-08-071.0-beta-2 | 2019-03-201.0-beta-1 | 2019-01-10

1.1

Fix a fatal error that occurs when a form is submitted with the date mapped to "Date & Time Fields" or "Custom Date & Time".

1.0 | 2021-07-21

Official release.

1.0-beta-7.5

Fixed UI issues in the feed settings page where the post date setting don't show options for the value selected.
API: Added gf_advancedpostcreation()->update_post( $post_id, $feed, $entry, $form ) to enable programmatic updating of posts.

1.0-beta-7.4

Fixed a compatibility issue with Gravity Forms 2.5 by updating the postExcerpt field to explicitly allow HTML.
Fixed an issue that causes custom dates and times entered into the feed settings to use UTC instead of the local time.

1.0-beta-7.3

Updated the post content field in the feed settings to use the text editor to enable easier markup entry.

1.0-beta-7.2

Added a custom icon for Gravity Forms 2.5.

1.0-beta-7.1

Updated the Swedish translations.

1.0-beta-7 | 2020-09-28

Fixed an issue with the feed settings.

1.0-beta-6 | 2020-09-24

Added support for Gravity Forms 2.5

1.0-beta-5 | 2020-08-05

Added support for WordPress 5.5.
Updated Post Format labels to be translatable.
Fixed a JavaScript error with WordPress 5.5 which prevents the taxonomy settings rendering correctly.
Fixed an issue where pending and draft posts created via the add-on do not have the correct post creation date when the date mappings are used in the post creation feed.
Fixed an issue where merge tags used in the custom value inputs of the categories and tags feed settings are not processed.

1.0-beta-4 | 2020-05-07

Added translations for Hebrew, Hindi, Japanese, and Turkish.
Added the {apc_media} merge tag to insert IDs or URLs of files uploaded to media library.
Updated Javascript files, stylesheets to use minified versions.
Fixed an issue where a taxonomy mapping which is removed on the feed configuration page can still be processed.
Fixed an issue where the wrong user could be assigned as the media author.
Fixed an issue attaching uploaded images as a featured image for a post when the image file has uppercase characters in the file extension.

1.0-beta-3 | 2019-08-07

Added security enhancements.
Added support for delaying feed processing until after payment has been successfully completed using the PayPal Standard Add-On.
Added the gform_advancedpostcreation_args_pre_get_custom_post_types filter enabling the arguments used to get the custom post types for inclusion in the types setting to be overridden.
Added the gform_advancedpostcreation_file_fields_choices filter enabling the available choices for the media settings to be overridden on the feed configuration page.
Added the gform_advancedpostcreation_term_separator filter enabling the ability to override the default comma separator with another string when terms are being assigned from the value of a field on a form with a post creation feed set up.
Added additional logging statements.
Updated + and - icons so that they are consistent across all settings.

1.0-beta-2 | 2019-03-20

Added support for {post_id} and {post_edit_url} merge tags.
Added support for setting post author when user is registered with User Registration Add-On.
Fixed an issue getting the default merge tags for the title, content, and excerpt settings when creating a new feed.
Fixed an issue where files could fail to be added to the media library on servers where allow_url_fopen is disabled.
Updated feed processing to store the uploaded media IDs in the entry meta along with the post and feed IDs.

1.0-beta-1 | 2019-01-10

It's all new!

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

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

IntroductionThe add_button() method

Introduction
Back in the day you could use the gform_add_field_buttons filter to add the buttons for custom fields and add custom field groups.
With the introduction of the GF_Field class adding a field to an existing group is a simple as overriding the get_form_editor_button() method. But what about adding the field button to a custom group?
Introducing the add_button() method.
The add_button() method
GF_Field::add_button() is responsible for adding the field button to the group specified in the array returned by get_form_editor_button(), however, if the group does not exist the button won』t be added.
If you were to use the gform_add_field_buttons filter to add your custom group you would find the group is added but your new field isn』t added to the group, that』s because the filter runs after the fields are added to the groups. You could update your function hooked to the gform_add_field_buttons filter to also add the button to the group but what would be the fun in that.
The following example shows how you can override the add_button() method to include a custom group if it doesn』t already exist.
123456789101112/** * Adds the field button to the specified group. * * @param array $field_groups The field groups containing the individual field buttons. * * @return array */public function add_button( $field_groups ) {    $field_groups = $this->maybe_add_field_group( $field_groups );     return parent::add_button( $field_groups );}
And here』s the function which actually performs the check and then returns the updated array of groups.
1234567891011121314151617181920212223/** * Adds the custom field group if it doesn't already exist. * * @param array $field_groups The field groups containing the individual field buttons. * * @return array */public function maybe_add_field_group( $field_groups ) {    foreach ( $field_groups as $field_group ) {        if ( $field_group['name'] == 'your_custom_group_name' ) {             return $field_groups;        }    }     $field_groups[] = array(        'name'   => 'your_custom_group_name',        'label'  => __( 'The Group Label', 'simplefieldaddon' ),        'fields' => array()    );     return $field_groups;}
Now when you your get_form_editor_button() function looks like this your field button will be added to the custom group.
1234567891011/** * Assign the field button to the custom group. * * @return array */public function get_form_editor_button() {    return array(        'group' => 'your_custom_group_name',        'text'  => $this->get_form_editor_field_title(),    );}

$_async_feed_processing

$_async_feed_processing

DescriptionPropertiesUsageLocation

Description
The $_async_feed_processing property allows you to define a feed as asynchronous. By using this property, the feed will be processed asynchronously instead of at the same time other feeds are.
Properties
Class: GFFeedAddOn
Access: protected
Type: boolean
Defaults to: false
Usage
123class ExampleFeedAddOn extends GFFeedAddOn {    protected $_async_feed_processing = true;}
Location
includes/addon/class-gf-feed-addon.php

Address

Address

SummaryCommon Field SettingsGeneral SettingsAddress TypeAddress FieldsAppearance SettingsAdvanced SettingsUse values submitted in a different fieldCustom FormatConditional Logic SupportCSS Targeting ExamplesExtending the Address FieldMerge TagsUsageModifiers

Summary

The Address field makes it quick and easy to capture address information on a form. This field provides a pre-formatted area for two street addresses, city, state/province, zip/postal code, and a drop down for country selection. It is available under the Advanced Fields section within the form editor.

Address field as displayed in the Field Library

Address field as displayed in the Form Editor.

Common Field Settings

Many of the options in the General, Appearance and Advanced sections are common to most fields. Refer to this article for a description of those common settings.

In the section below, you will find description of those settings that are unique to this field type.

General Settings

Address Type

Select the type of address you would like to use, from the choices of International, United States, Canadian.

International

United States

Canada

You can add support for a custom address type by using the gform_address_types filter. This filter can also be used to update the format of the predefined options as well.

Address Fields

OptionsDescriptionsShow (toggle)Show or hide specific address sub-fields. For example, you could opt to hide Address Line 2, show ZIP Code, but hide the StateCustom Sub-LabelReplace the default address sub-field labels with custom text. For example, replace 「Address Line 2」 with 「Suite or Apartment #」.Default Country/State/ProvinceYou can specify a default country value (for international address type), default state (for US address type) or default province (for Canadian address type).

Appearance Settings

SettingDescriptionSub-Label PlacementSimilar to the Description Placement option, but instead applies to the sub-label defined in the General settings.

Advanced Settings

SettingDescriptionDefault ValuesDefine a default value for each sub-field. Note that anything entered here will override the Default Country/State/Province General Setting. If using a drop down list of values (e.g. State, Province or Country), the value entered here must be an exact match to a value offered in that list.Display Option Allows you to populate the field from the information submitted in another Address field. For example, to make the shipping address fields the same as the billing address.Refer to section below for additional options.

Use values submitted in a different field

Checking this setting opens a further options as described below.

SettingDescriptionOption LabelText that appears next to the checkbox, defaults to 「Same as previous」 checkbox. An example would be: 「Use billing address.」Source FieldIdentify the Address field that will provide the data to this field.Activated by defaultTurn』s on the 「use other values」 option by default at form load. This will hide the address fields, and display only the (filled) check box. If a user un-checks it, the other fields will appear again.

Custom Format

To change the expected format of one of the offered custom formats, you can replace the Address field with multiple Single Line Text fields, and establish an input mask for those you wish to be non-standard. You can learn more about input masks in this article.

Conditional Logic Support

You can configure conditional logic rules on other fields based on the values of the Address sub-field inputs.

CSS Targeting Examples

Address Field Targeting Examples

Extending the Address Field

Looking for information about what properties the Address field uses in the Field Object, what format its value is stored in the Entry Object and how you can access it, or what hooks/filters it includes? Then take a look at the GF_Field_Address article.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

Display the Street Address.

{Field Name:2.1}

Display the Address Line 2.

{Field Name:2.2}

Display the City.

{Field Name:2.3}

Display the State / Province.

{Field Name:2.4}

Display the ZIP / Postal Code.

{Field Name:2.5}

Display the Country.

{Field Name:2.6}

Modifiers

This merge tag does not have any modifiers.