DescriptionUsagePlacement
Description
Indicates if the current page is a WordPress admin page.
Usage
define( 'IS_ADMIN', is_admin() );
Placement
This constant is set in the file gravityforms.php.
DescriptionUsagePlacement
Description
Indicates if the current page is a WordPress admin page.
Usage
define( 'IS_ADMIN', is_admin() );
Placement
This constant is set in the file gravityforms.php.
SummaryUsage
Summary
Displays the form submitter』s IP address.
Usage
{ip}
Invoice SendingPO NumbersDiscountsLine ItemsNotesTerms
Within the feed settings of the FreshBooks Add-On, you may have noticed that you are able to easily create invoices and estimates using your form submission data. In this article, we will show you how to do so.
Note: This article assumes you have selected Invoice or Estimate for the Also Create option in the FreshBooks Add-On settings. If you need help locating this option, take a look at the creating feeds for the FreshBooks Add-On article.
Invoice Sending
By default, the FreshBooks Add-On creates invoices/estimates as drafts and does not automatically send them. If you would like FreshbBooks to automatically send the invoice to the customer, select the option labeled Send Invoice/Estimate By Email.
PO Numbers
By default, the FreshBooks Add-On will not set a PO number. If you want to set a PO number, you can use the PO Number dropdown to select the field that will contain it.
Discounts
Discounts can be applied using the Discount option and are applied to all invoices/estimates created by this feed. Entering a number here will apply that percentage discount to the total invoice/estimate amount.
If you want to set a specific numerical amount to discount, consider using form calculations instead.
Line Items
Within the Line Items option, you can specifically set line items that you want to display within the invoice/estimate. By default, all product fields on the form will be used.
When selecting Fixed Costs and Quantities, additional settings will appear. Within these settings, you can select your products and provide custom data for them such as Description, Unit Cost, and Quantity.
Notes
If you want to set any notes for the invoice/estimate created in FreshBooks, you can use the Notes setting to do so. Inside the text box, you can enter the note that you want displayed, as well as use merge tags to generate dynamic content.
To review and insert available merge tags, you can use the icon to the right of the field.
Terms
If you have terms that apply to the generated invoice/estimate, you can enter them within the Terms setting. Note that this option only supports static content, so merge tags cannot be used here. If you want to set terms for different invoices/estimates, you may want to create multiple feeds and use conditional logic.
Installing Gravity Forms Add-Ons using the Add-On BrowserInstalling Gravity Forms Add-Ons using the WordPress dashboardInstalling Gravity Forms Add-Ons using FTPActivate the Add-On and Review the Settings
Installing Gravity Forms Add-Ons is as simple as installing Gravity Forms. The simplest method is using the Add-On browser. In this article, we will show you each of the possible methods that can be used for installation.
Installing Gravity Forms Add-Ons using the Add-On Browser
Log into your WordPress admin dashboard.
Hover over Forms and click on Add-Ons.
Here you will see a list of all available add-ons. To install one, simply click the Install button. Once the Install button is clicked, WordPress will handle the download and installation of the Gravity Forms Add-On. Be sure to click Activate Plugin to activate the add-on.
Installing Gravity Forms Add-Ons using the WordPress dashboard
Download the zip file for your desired add-on. Access the Gravity Forms Add-On download page, click the add-on that you want to install, and download the zip file for it.
Log into your WordPress admin dashboard.
Hover over Plugins on the left side admin menu and click on Add New.
At the top of this page, click on Upload Plugin. Then click on Choose file and locate the zip file containing the add-on. Click the Install Now button.
WordPress will automatically handle the unpacking and installation for your Gravity Forms add-on. Once complete, click on Activate Plugin to activate it.
Installing Gravity Forms Add-Ons using FTP
Download the add-on zip file from the Gravity Forms add-on download page and unpack it.
Once you have your add-on files unzipped, connect to your server over FTP and navigate to the wp_content/plugins folder and upload the add-on files that you have unpacked.
Once the files have been successfully uploaded to the server, log into your WordPress admin dashboard.
Click on Plugins from the left side navigation menu.
You should see an entry for the add-on that you have uploaded. Click Activate to activate it.
Activate the Add-On and Review the Settings
Now that you have successfully installed an add-on for Gravity Forms, don』t forget to go to your WordPress admin Plugins page and activate it. There may also be settings required to enable the add-on』s functionality. Further information on individual add-ons can be found in their respective articles under the Add-Ons document category.
Standard Input MasksCustom Input MasksAccepted Input Mask CharactersNotesExamples
Input Mask options are available under the General Settings panel, and only for the Single Line Text field and the Post Custom Field. They can provide more granular control over the permitted entry formats than the standard fields such as Phone Number or Address Postal Code.
Standard Input Masks
Standard input masks provide a variety of common United States input formats to choose from. The choices are offered as standard are listed below. In all cases, any non-numeric digits are auto-inserted (e.g. the spaces, parentheses, dashes, etc.)
Standard OptionPattern OfferedUS PhoneStandard US formatted phone number. (###) ###-####US Phone + ExtStandard US formatted phone number with business style extension of up to 5 digits. (###) ###-#### x#####DateUS style mm/dd/yyyy numeric date format. ##/##/####Tax IDUS style tax identification number.##-#######SSNUS style special security number.###-##-#####Zip CodeUS style zip code format#####Full Zip CodeUS style zip+4 format. #####-####
Custom Input Masks
Input masks provide a visual guide allowing users to more easily enter data in a specific format such as dates and phone numbers. The input mask in the image above allows the user to add two digits for the month, two digits for the day, and four digits for the year. No letters or any other characters will work, only numbers.
Accepted Input Mask Characters
The following symbols are accepted as placeholders in input masks and provide some basic pattern matching.
SymbolMeaning9Accepts any numeric characteraAccepts any alphabetic character (must be lower case)*Accepts any single alphanumeric character.?Indicates that all characters defined by the mask after the question mark are optional. any otherAll other characters are literal values and will be displayed as is.
Notes
A customer will only see underscores when they enter the field, which identifies the quantity of characters the field expects, but not their type. We recommend you provide additional visual help for complicated masks, such as a field description or a placeholder example. If the 「Enable password input」 advanced property is checked, it will override the input mask functionality.
Examples
Here are some sample masks, and what an accepted input would be.
Date mask: 99/99/9999 → would accept 05/21/2011 or 21/05/2011, but not 05/21/11 and not 5/21/2011Social security mask: 999-99-9999 → would accept 987-65-4329 but not 800-555-FORMCode mask: aaa 999 → would accept BIO 101 but not B1O 5F0Key mask: ***-***-*** → would accept a9a-f0c-28QUS Zipcode+4 mask: 99999?-9999 → would accept 23462 or 23462-4062
If you have discovered a vulnerability in one of our products we want to hear from you as soon as possible. Please gather as much information together as you can so we can work quickly to address it. Here』s a checklist of the details we』d like to see.
Severity (high, medium, low)
Vulnerability Type: e.g., DoS, Overflow, XSS, CSRF, etc
Exploitation Requires Authentication?: yes/no
Version(s) of Gravity Forms (or Add-On) affected
A description of the vulnerability
Do you have reason to believe the vulnerability is being exploited?
Are details of an exploit publicly available? If so, please provide us with a URL.
What is the potential impact? How do you envisage it being used in an attack scenario?
DREAD score, if known.
CVE Identifier / Reference / Advisory Number, if applicable.
If you wish to be credited for the responsible disclosure in the release announcement and the change log, please let us know. If you plan to disclose details of the vulnerability, please do let us know so we can coordinate the timing of the disclosure together.
Any additional comments.
If you are a customer please open a support ticket as soon as possible and make it clear in the subject that your are reporting a security vulnerability.
If you are not a customer send all the details to [email protected]. We have developers in a few time zones so don』t assume you have to leave it till the morning.
We』ll acknowledge receipt as soon as we』ve read it. If confirmed we』ll plan a patch and let you know when we plan to release it.
Modifying WordPress』 memory limitModifying your server』s memory limitModifying your memory limit in php.iniModifying your memory limit in .htaccessFollow your web host』s instructions
Sometimes, you may come across issues such as errors when exporting a large number of entries, or even errors stating that your available memory has been exhausted. These errors are caused by PHP limits within the server and/or the WordPress installation being too low for the amount of data being processed.
In this article, we will show you how to fix errors related to your PHP memory limits.
Note: In most cases, you will need to modify the PHP memory limit within WordPress, as well as your server』s PHP memory limit. Increasing only one of these may cause your issue to persist due to the limit in the other.
Modifying WordPress』 memory limit
Note: Even after increasing your memory limit inside this file, you will still also need to increase it on the server side, usually in your php.ini file. If either of these is too low, you will still experience issues.
To modify the memory limit used by WordPress, place the following in your wp-config.php file. This file is located at the home directory of your WordPress installation.
1define( 'WP_MEMORY_LIMIT', '4086M' );
Of course, you can change this to anything you want to. In the above example, we have simply set PHP scripts to be able to use 4GB on memory which is far more than should be required.
Modifying your server』s memory limit
As stated in the previous section, you will need to change both the WordPress memory limit and the server memory limit. In addition to the steps in this section, be sure to follow the instructions in the above section to increase the memory limit available to WordPress.
Note: You do not need to (or may not even be able to) complete all of the below items. One of them is enough.
Modifying your memory limit in php.ini
If you have a php.ini file within your site』s home directory, locate the line containing memory_limit and edit it to the following:
1memory_limit = 4086M
Modifying your memory limit in .htaccess
If you don』t have a php.ini file available, you may be able to modify your memory limit from within your .htaccess file. This file is located within the home directory of your site. If you don』t see if, be sure that hidden files are visible.
Place the following in the top of your .htaccess file:
1php_value memory_limit 4086M
Follow your web host』s instructions
As we cannot entirely predict every variable within your web host』s configuration, these are generic, common settings and you may need to take further steps if the above settings do not work. A few popular hosts』 steps on changing your php memory limit can be found at the following:
Bluehost
GoDaddy
Hostgator
InMotion Hosting
Kinsta
SiteGround
Modifying your max execution time in php.iniModifying your max execution time in .htaccess
If you are receiving errors due to PHP scripts timing out when manipulating large amounts of data, such as a large import or export, you may need to increase the max execution time in PHP. In this article, we will show you how to do so.
When following these steps, keep in mind that these are generic instructions, as we cannot possibly account for every change in your web hosting environment. If these steps are unable to resolve your issue, or if you have any concerns about them, your best and quickest solution is to contact your web host.
Note: Only one of the following steps should be necessary. If one of them resolves your issue, there is no need to do the other.
Modifying your max execution time in php.ini
Depending on your hosting provider, you may have a php.ini file within your home directory. If it is present, find the max_execution_time parameter and modify it to increase the number of seconds PHP scripts are allowed to run.
max_execution_time = 300
Modifying your max execution time in .htaccess
If you are unable to change your max execution time from within a php.ini file, you may be able to change it within your .htaccess file. This file is typically located within your home directory. If you don』t see it, be sure you are able to see hidden files.
Place the following in the top of your .htaccess file:
php_value max_execution_time 300
IntroductionGetting StartedDefine the Add-On classDefine the Field classDownload the Sample Add-On
Introduction
In this article we will show how you can use the Add-On Framework to include a new field type which extends the GF_Field class.
Getting Started
Create a file with your add-on slug as the filename, this file will contain your plugin headers, define the version number, and handle including the actual add-on after Gravity Forms has loaded.
Here is the content of our simplefieldaddon.php file, excluding the plugin headers.
123456789101112131415161718define( 'GF_SIMPLE_FIELD_ADDON_VERSION', '1.0' ); add_action( 'gform_loaded', array( 'GF_Simple_Field_AddOn_Bootstrap', 'load' ), 5 ); class GF_Simple_Field_AddOn_Bootstrap { public static function load() { if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) { return; } require_once( 'class-gfsimplefieldaddon.php' ); GFAddOn::register( 'GFSimpleFieldAddOn' ); } }
Define the Add-On class
Create a second php file, in this case we have named it class-gfsimplefieldaddon.php.
In this file you would include the Add-On Framework files by calling the following:
1GFForms::include_addon_framework();
Inherit the Add-On Framework by creating a new class which extends GFAddOn:
1class GFSimpleFieldAddOn extends GFAddOn {}
Add the class variables to configure the add-on.
1234567protected $_version = GF_SIMPLE_FIELD_ADDON_VERSION;protected $_min_gravityforms_version = '1.9';protected $_slug = 'simplefieldaddon';protected $_path = 'simplefieldaddon/simplefieldaddon.php';protected $_full_path = __FILE__;protected $_title = 'Gravity Forms Simple Field Add-On';protected $_short_title = 'Simple Field Add-On';
Add support for getting an instance of the add-on.
When Gravity Forms is loading it initializes the add-ons, it does this by looping through each registered add-on and calling its get_instance function. Adding a get_instance function also helps other developers integrate with your add-on.
123456789private static $_instance = null; public static function get_instance() { if ( self::$_instance == null ) { self::$_instance = new self(); } return self::$_instance;}
Include the new field.
To ensure that the new field is available when entry exports are performed we will include the file containing our fields class by overriding the pre_init() function.
1234567public function pre_init() { parent::pre_init(); if ( $this->is_gravityforms_supported() && class_exists( 'GF_Field' ) ) { require_once( 'includes/class-simple-gf-field.php' ); }}
Add any custom settings and tooltips required by the field.
New settings can be defined by using the gform_field_standard_settings, gform_field_appearance_settings, and gform_field_advanced_settings hooks.
Tooltips for those new settings can also be defined using the gform_tooltips filter.
As these hooks are only required in the admin we can include them by overriding the init_admin() function like so:
123456public function init_admin() { parent::init_admin(); add_filter( 'gform_tooltips', array( $this, 'tooltips' ) ); add_action( 'gform_field_appearance_settings', array( $this, 'field_appearance_settings' ), 10, 2 );}
Define the tooltips function:
1234567public function tooltips( $tooltips ) { $simple_tooltips = array( 'input_class_setting' => sprintf( '
%s', esc_html__( 'Input CSS Classes', 'simplefieldaddon' ), esc_html__( 'The CSS Class names to be added to the field input.', 'simplefieldaddon' ) ), ); return array_merge( $tooltips, $simple_tooltips );}
Define the field_appearance_settings function:
123456789101112131415public function field_appearance_settings( $position, $form_id ) { // Add our custom setting just before the 'Custom CSS Class' setting. if ( $position == 250 ) { ?>
'advanced_fields', 'text' => $this->get_form_editor_field_title(), );}
Review the GF_Field article to see the other methods you can override to define your new fields appearance and functionality.
At the end of the file, after your fields class, register the new field with Gravity Forms:
1GF_Fields::register( new Simple_GF_Field() );
Download the Sample Add-On
The sample add-on used in the examples above, including inline documentation, is available from here:
https://github.com/richardW8k/simplefieldaddon
IntroductionScriptsScripts ExampleStylesStyles ExampleEnqueue Conditions
Introduction
Scripts and styles can be included for an add-on by overriding the scripts() and styles() functions with structured arrays. All scripts and styles will be added automatically to the Gravity Forms no-conflict mode whitelist.
Scripts
The scripts() function must return an associative array with the following properties:
handle string
The script will be registered with WordPress using this handle.
src string
The URL of the script.
version string
The version number to be added to the query parameters for cache busting. Set to null to disable.
deps array
An array of handles for scripts which are required before this script is loaded.
in_footer boolean
Determines if the scripts will be enqueued in the footer.
callback array
Function that is called when the script is enqueued.
strings array
An array of strings that can be accessed in JavaScript through the global variable [script handle]_strings.
enqueue array
An array of conditions for loading the script. See Enqueue Conditions.
Important: When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued.
Scripts Example
12345678910111213141516171819202122232425public function scripts() { $scripts = array( array( 'handle' => 'my_script_js', 'src' => $this->get_base_url() . '/js/my_script.js', 'version' => $this->_version, 'deps' => array( 'jquery' ), 'in_footer' => false, 'callback' => array( $this, 'localize_scripts' ), 'strings' => array( 'first' => __( 'First Choice', 'simpleaddon' ), 'second' => __( 'Second Choice', 'simpleaddon' ), 'third' => __( 'Third Choice', 'simpleaddon' ) ), 'enqueue' => array( array( 'admin_page' => array( 'form_settings' ), 'tab' => 'simpleaddon' ) ) ), ); return array_merge( parent::scripts(), $scripts );}
Styles
The styles() function must return an associative array with the following properties:
handle string
The CSS file will be registered with WordPress using this handle.
src string
The URL of the CSS file.
version string
The version number to be added to the query parameters for cache busting. Set to null to disable.
deps array
An array of handles for scripts which are required before this script is loaded.
media string
The media for which this stylesheet has been defined.
enqueue array
An array of conditions for loading the css file. See Enqueue Conditions.
Important: When overriding this function, be sure to call parent::styles() to ensure the base class scripts are enqueued.
Styles Example
1234567891011121314public function styles() { $styles = array( array( 'handle' => 'my_styles_css', 'src' => $this->get_base_url() . '/css/my_styles.css', 'version' => $this->_version, 'enqueue' => array( array( 'field_types' => array( 'poll' ) ) ) ) ); return array_merge( parent::styles(), $styles );}
Enqueue Conditions
Scripts and styles should always be loaded only when needed. The Add-On Framework provides a simple way to configure this for each of the JavaScript and CSS files. When overriding scripts() and styles() be sure to include the 「enqueue」 array with any or all of the following properties:
callback array
Function that is called to determine if the script or stylesheet can be enqueued.
Example:
1array( $this, 'requires_script' )
admin_page array
Specify one or more pages (known pages) where the script is supposed to be enqueued. When this setting is specified, scripts will only be enqueued in those pages. Possible values: form_editor, form_settings, plugin_settings, plugin_page, entry_view, entry_detail, results.
Example:
1array( 'admin_page' => array( 'form_settings', 'plugin_settings' ) )
tab array
Specifies a form settings or plugin settings tab in which the script is supposed to be enqueued. If none is specified, the script will be enqueued in all of the form settings or plugin_settings pages.
Example:
1array( 'tab' => 'signature' )
query string
Specifies a set of query string ($_GET) values. If all specified query string values match the current requested page, the script will be enqueued. Note that _empty_ and _notempty_ can be used as 「smart」 values.
Example:
1array( 'query' => 'page=gf_edit_forms&view=settings&id=_notempty_' )
post string
Specifies a set of post ($_POST) values. If all specified posted values match the current request, the script will be enqueued.
Example:
1array( 'post' => 'posted_field=val' )
field_types array
Specifies one or more field types that requires this script. The script will only be enqueued if the current form has a field of any of the specified field types. Only applies when a current form is available.
Example:
1array( 'field_types' => array( 'signature' ) )