If you want to add a page to the Gravity Forms Admin navigation options, add the following code to your theme』s functions.php file.
1234567891011add_filter( 'gform_addon_navigation', 'create_menu' );function create_menu( $menus ) { $menus[] = array( 'name' => 'my_custom_page', 'label' => __( 'My Custom Page' ), 'callback' => 'my_custom_page' ); return $menus;} function my_custom_page(){ echo 'My Custom Page!'; }
This would create a page called My Custom Page that shows text on it that says My Custom Page.
Author 诗语
$_supports_callbacks
DescriptionPropertiesUsageLocationUsed By
Description
The $_supports_callbacks property defines if your payment add-on supports callbacks. By enabling this property within your payment add-on, you can easily receive and process callbacks.
Properties
Class: GFPaymentAddOn
Access: protected
Type: boolean
Defaults to: false
Usage
123class ExamplePaymentAddOn extends GFPaymentAddOn { protected $_supports_callbacks = true;}
Location
includes/addon/class-gf-payment-addon.php
Used By
GFPaymentAddOn::upgrade_payment()
{admin_email} Merge Tag
SummaryUsage
Summary
Displays email address configured on the WordPress > Settings > General page.
Usage
{admin_email}
Obtaining Your Campaign Monitor API Key
To begin using the Campaign Monitor Add-On for Gravity Forms, you will first need to add your API key. In this article, we will show you how to retrieve your Campaign Monitor API key.
Log into your Campaign Monitor account.
Click on Account settings at the top of the page.
Click on the API Keys link on the right side of the page to view your API Keys.
Adding Mailchimp Subscriptions to Groups
When using the Mailchimp Add-On, you can add users to groups to better target subscribers. For example, if you want to send an email to all users who have shown interest in baseball, you can group users by interest so that the content can be specifically tailored to them. This differs from Audiences because subscribers can be part of multiple groups without signing up for multiple Audiences.
Here』s how to easily add users to different groups based on their form submissions:
Ensure that the group exists within Mailchimp. If not, you』ll need to log into your Mailchimp account and create the group.When creating a feed for the Mailchimp Add-On, select the audience that contains your group.If groups exist within the audience, they will automatically appear with checkboxes next to each of them. Upon enabling a group, you will be able to select if all subscribers on the form will be added to the audience, or just ones that fall under a specific condition. For more information on using conditions, see our article on configuring conditional logic.Save your feed.
Access Your Form Settings
IntroductionFrom the Form List ScreenFrom the Form Editor Screen
Introduction
Each of your forms has its own set of settings and options that affect only that form. This is different to the global Gravity Forms Settings that affect all your forms. This article shows you how to access your form-specific settings.
From the Form List Screen
Hover over the form title you wish to change in the list.When the menu appears below the form title, click or hove over settings to expose a drop down showing Form Settings. Now you can edit the settings you need. Once you are done, don』t forget to scroll to the bottom and click Save Settings.
In this animation, we access the Form Settings from the list view, and make a small change to the form title.
From the Form Editor Screen
Hover over or click Settings in the top bar.In the drop down menu that appears, click form Settings.
In this animation, we access the Form Settings from the Form Editor, and make another edit to the form title.
Adding a Form Using a Theme File or Hooks
SummaryFunction CallUsage ExamplesEnqueue Scripts and Styles
Summary
In this article, we show how to use the Gravity Forms function call embedding method that would allow you to add a form to a page or post using a theme file or third-party hooks.
Function Call
If you would like to call a form from within a WordPress theme file, you may do so using a function call. The function and its available parameters are outlined below.
gravity_form( $id_or_title, $display_title = true, $display_description = true, $display_inactive = false, $field_values = null, $ajax = false, $tabindex, $echo = true );
$id_or_title
(mixed) (required) The id or title of the form to be embedded.
$display_title
(boolean) (optional) Whether or not to display the form title.
Defaults to true.
$display_description
(boolean) (optional) Whether or not to display the form description.
Defaults to true.
$display_inactive
(boolean) (optional) Whether or not to display the form even if it is inactive.
Defaults to false.
$field_values
(array) (optional) Pass an array of dynamic population parameter keys with their corresponding values to be populated.
Example: 「array(『parameter_name』 => 『custom_value』)」
Defaults to false.
$ajax
(boolean) (optional) Whether or not to use AJAX for form submission.
Defaults to false.
$tabindex
(integer) (optional) Specify the starting tab index for the fields of this form.
$echo
(boolean) (optional) Whether to echo the form code or return it.
Defaults to true.
Usage Examples
Basic Function Call
gravity_form( 1, false, false, false, '', false );
This snippet will display the form with an id of 『1』; the title and description will not be displayed, the form itself will not display if it is inactive, and it will not use AJAX for form submission.
With Ajax & Tabindex
gravity_form( 1, false, false, false, '', true, 12 );
This snippet will display the exact same form as above except it will use AJAX for form submission and the starting tabindex will be 12.
Using the Form Title instead of ID
gravity_form( 'Contact Us', false, false, false, '', false );
This snippet will display the form titled 『Contact Us』; the title and description will not be displayed, the form itself will not display if it is inactive, and it will not use AJAX for form submission.
If you use the id for a form that does not exist, the following message will be displayed:
Oops! We could not locate your form.
Pass a variable for Dynamic Population
gravity_form( 1, false, false, false, array('some_field' => $my_variable ), false);
This snippet will do the same shown above for Basic Function Call adding the array to pass a variable named $my_variable that will populate a field that has the parameter name some_field
Enqueue Scripts and Styles
When embedding a form via a function call you must also manually include the necessary Gravity Forms related Javascript and CSS via the built in WordPress enqueue capabilities. Gravity Forms does not include these by default when calling a form via a function call and they are necessary for forms that contain conditional logic or the date picker field.
We strongly recommend you enqueue the scripts rather than including them as hardcoded calls in your theme. Implementing it this way will insure that Gravity Forms does not include them on the page if they are already present. It is also a good practice to only load these scripts on the front end.
Gravity Forms 1.5 introduced the gravity_form_enqueue_scripts function which allows you to easily enqueue the necessary Gravity Forms』 scripts and styles when manually embedding a form. This is also useful if you are using a GF widget and do not wish for the styles and scripts to be loaded inline.
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!