Gravity Forms and PHP 8.0 Compatibility

Gravity Forms and PHP 8.0 Compatibility

CompatibilityReporting IssuesKnown IssuesUpdates

Compatibility

PHP 8.0 is a major new release of the PHP language with many changes.

WordPress is working towards full compatibility with PHP 8.0, but has ascertained a 「beta-compatible」 status. With that, the Gravity Forms product team are also working on compatiblity tests and fixes for any issues found.

At this point, we do not consider Gravity Forms to be proven compatible, and are working towards discovering and resolving issues across all our core and add-on products.

Reporting Issues

If you think you have discovered a PHP 8 related issue with a Gravity Forms product in your own testing, please let us know by contacting Support. Thank you for contributing!

Known Issues

The following issues are known to the team:

version_compare() fatal error in gravityforms.php – Fixed in 2.4.23.Unknown named parameter fatal error in class-gf-addon.php when enqueueing scripts – Fixed in 2.4.23.Multiple 「required parameters following optional parameter」 deprecation notices in Gravity Forms core and add-ons. – Fixed in 2.5 and various add-on updatesusort() returning bool from comparison function is deprecated notice in form_list.php – Fixed in 2.4.23.

Updates

This article will be updated to show the status of known issues, compatibility testing, and to identify expected releases for fixes.

Gravity Forms Add-On Slugs

Gravity Forms Add-On Slugs

The following slugs are used by the Add-On Framework based add-ons developed by Rocketgenius, Inc. The slugs are lowercase and prefixed gravityforms followed by the add-ons short title, omitting any spaces or special characters.

Some hooks may omit the gravityforms prefix when using the slug, such as the gform_short_slug_field_value filter.

Add-OnSlugShort Slug2Checkoutgravityforms2checkout2checkoutActiveCampaigngravityformsactivecampaignactivecampaignAdvanced Post CreationgravityformsadvancedpostcreationadvancedpostcreationAgile CRMgravityformsagilecrmagilecrmAuthorize.netgravityformsauthorizenetauthorizenetAWebergravityformsaweberaweberBreezegravityformsbreezebreezeCampaign MonitorgravityformscampaignmonitorcampaignmonitorCampfiregravityformscampfirecampfireCapsule CRMgravityformscapsulecrmcapsulecrmChained SelectsgravityformschainedselectschainedselectsCleverReachgravityformscleverreachcleverreachGravity Forms CLIgravityformsclicliConstant ContactgravityformsconstantcontactconstantcontactCouponsgravityformscouponscouponsDebuggravityformsdebugdebugDropboxgravityformsdropboxdropboxEmailOctopusgravityformsemailoctopusemailoctopusEmmagravityformsemmaemmaFreshBooksgravityformsfreshbooksfreshbooksGetResponsegravityformsgetresponsegetresponseGravity Forms GutenberggravityformsgutenberggutenbergHelp ScoutgravityformshelpscouthelpscoutHighrisegravityformshighrisehighriseHipChatgravityformshipchathipchatHubSpotgravityformshubspothubspotiContactgravityformsicontacticontactLogginggravityformsloggingloggingMad MimigravityformsmadmimimadmimiMailChimpgravityformsmailchimpmailchimpMailgungravityformsmailgunmailgunMolliegravityformsmolliemolliePartial EntriesgravityformspartialentriespartialentriesPayPal Checkout*gravityformsppcpppcpPayPal StandardgravityformspaypalpaypalPayPal Payments ProgravityformspaypalpaymentspropaypalpaymentsproPipegravityformspipepipePollsgravityformspollspollsPostmarkgravityformspostmarkpostmarkQuizgravityformsquizquizSendGridgravityformssendgridsendgridSignaturegravityformssignaturesignatureSlackgravityformsslackslackSquaregravityformssquaresquareStripegravityformsstripestripeSurveygravityformssurveysurveyTrellogravityformstrellotrelloTwiliogravityformstwiliotwilioUser RegistrationgravityformsuserregistrationuserregistrationWebhooksgravityformswebhookswebhooksZapiergravityformszapierzapierZoho CRMgravityformszohocrmzohocrm

(*) Previously named PayPal Commerce Platform.

Gravity Forms 2.5 Known Limitations

Gravity Forms 2.5 Known Limitations

IntroductionKnown Changes & LimitationsJavascriptForm EditorColumnsTranslationsMobile DisplayAdd-OnsDeprecated ItemsFiltersAdd-On Framework ChangesFound Something Not Listed Here?

Introduction

This document details some changes to existing behavior in Gravity Forms 2.5 that may affect existing setups or behaviors, or might require changes to your site. These compromises are deliberate, and are not targeted for change unless identified otherwise.

Known Changes & Limitations

Javascript

Javascript is moved to the footer by default in Gravity Forms 2.5. Custom approaches that move Gravity Forms scripts to the footer themselves will no longer work and will need to be removed.

Form Editor

The form editor is designed to be used on desktop and is designed for or supported on mobile devices.

Internet Explorer 11 (IE 11) is not supported for the Form Editor. It is not possible to edit label placement inside the layout editor—this can only be done in the settings.The gf_inline and the column ready classes are not supported in the new markup. This is superseded by the ability to drag & drop the fields columns directly using the editor.When conditional logic is configured to 「hide」 a form button, the button is not removed from the page as previously was the case, but disabled instead. Leaving it visible but inactive is a change made in support of improved accessibility.The Credit Card Field no longer has a Card Icon Style setting.

Columns

There is a maximum of 4 resizable columns. You cannot create a fifth.Columns are not supported on forms with legacy markup enabled. Disable legacy markup in the form settings to use the columns.The field types of Page, Section & Hidden cannot be placed in columns.

Translations

The datepicker is now translated automatically. The previous snippet that was used to load custom datepicker translations must be removed.A few strings may still need to be made translatable. This will be addressed in an upcoming patch.

Mobile Display

The form list toolbar and entry list filtering need to be updated to look correct on mobile devices. This will be addressed in an upcoming patch.

Add-Ons

Processing of BuddyPress field mappings for the User Registration add-on is not currently supported. Fixed in User Registration v4.8.

Deprecated Items

Filters

gform_notification_validation filter has been removed.

Add-On Framework Changes

The following methods have been deprecated, and will return null due to no action being taken.

GFAddOn::maybe_save_form_settings()GFAddOn::maybe_save_plugin_settings()

Found Something Not Listed Here?

Contact our Customer Support team here.

Gravity Forms 2.5 Release FAQ

Gravity Forms 2.5 Release FAQ

Frequently Asked QuestionsIs Gravity Forms 2.5 publicly released yet?What if I want it right now, can I download it?Does the new Form Editor use Gutenberg? What if I have disabled the block editor?Does the form editor have column support?Are there accessibility improvements?Are existing website forms backwards compatible?Will my existing custom theme or page builder work with Gravity Forms 2.5? Is there a change-log/feature list/bug list available?How do I report a bug or feedback?

Frequently Asked Questions

Is Gravity Forms 2.5 publicly released yet?

Yes! After multiple beta releases and a few Release Candidates, Gravity Forms 2.5 was released on 27th April, 2021. This release is staggered meaning the auto-update notices will roll out to our customers across a few weeks.

What if I want it right now, can I download it?

You can download it on-demand by logging into a Gravity Forms account and going to the Downloads area of your dashboard. You need to have an active license to download Gravity Forms.

Does the new Form Editor use Gutenberg? What if I have disabled the block editor?

The Gravity Forms editor does not use Gutenberg, but given WordPress』s commitment to the Gutenberg block editor aesthetic and usability, we have provided a similar user experience that feels native to the WordPress environment. Your use (or disabling of) the WordPress block editor has no affect on your Gravity Forms form editing environment.

Does the form editor have column support?

Yes! This much requested feature is now available. It currently supports up to 4 columns using drag-and-drop within the form editor. See this article on Working with Columns in the new Form Editor for more details.

Are there accessibility improvements?

Accessibility was a major focus of 2.5 product development, and trying to make the frontend forms as accessible as possible. We have made a lot of changes to the admin, but we can』t claim it』s fully accessible – yet! See these Kbase articles for more information on making compatible forms. This will continue to be an area of focus in future Gravity Forms releases as well, in keeping with our commitment to accessibility.

Are existing website forms backwards compatible?

Yes. Existing forms will default to use the same markup they』ve always used (called legacy markup). This means you don』t need to worry about existing forms when you install Gravity Forms 2.5.

Newly created forms will use the new markup but can be updated to use the legacy markup if required.

Will my existing custom theme or page builder work with Gravity Forms 2.5?

Our beta and RC phases were extended for over a year to give third party developers a chance to test and make updates to their products so they can work seamlessly with the new Gravity Forms. This was for the benefit of not just the huge library of third party add-ons that work with Gravity Forms, but also theme developers and third party page builders like Elementor, Beaver Builder, WPBakery, Oxygen or Divi. Many of these impose their styles and layout handlers on top of our markup, so when our layout or markup changes, they may need updating.

While many of our most popular third party plug-ins have been updated, we cannot provide any guarantee that all have done so for all scenarios. If you run into what looks like a new conflict using a theme or page builder (that you do not have when using the generic WP theme for example) after you upgrade, then reach out to the publisher of that plug-in and ask them if they are working on compatibility updates. Our talented Support Team can help you diagnose the issue (for example, running a conflict test), but you will still need to get back to the publisher for the any necessary tweaks.

Is there a change-log/feature list/bug list available?

There are a few different places you can get further information about Gravity Forms 2.5.

search this very document site!check out the many informative articles we published on Gravity Forms 2.5 during the beta period on the Gravity Forms blog.as always, keep an eye on the official Gravity Forms change log. see this document listing items that were deprecated in 2.5.

How do I report a bug or feedback?

Contact our talented Customer Support team.

Gravity Forms 2.5 Key Features

Gravity Forms 2.5 Key Features

SummaryMajor New FeaturesImproved Front-End AccessibilityForm Editor New UI designDrag and Drop ColumnsSettings and Admin New UI DesignSettings APIComplete Revamp of CSS StylesUpdates to MarkupTheme IntegrationOther Form Editor EnhancementsKnown Limitations

Summary

This article lists some of the key features you will most likely notice immediately when checking out the brand new Gravity Forms 2.5.

For an up-to-date list of all features, refer to the Gravity Forms official change log.

Refer to our FAQ for questions about the rollout process.

Major New Features

Improved Front-End Accessibility

Ethically and legally, creating accessible forms is becoming more and more essential, and an area we have publicly stated our commitment to enhance. 2.5 provides many improvements and sets all designers on a better path to easily creating accessible forms for your users – helping you to engage with all your audience and boosting your form submissions.

For more on improving the accessibility off your forms, refer to our comprehensive Accessibility knowledge base.

Form Editor New UI design

The form editor has been given a new look more familiar to WordPresses Gutenberg look and feel. Field Settings have been moved out of the form area to a right-side panel, which allows the form editor area to be the focus of your layout, and allowed us to introduce a new UI feature of…

Drag and Drop Columns

The Form Editor now supports drag and drop for up to 4 columns, allowing you to manage your form layout in a more intuitive way directly within the editor.

Settings and Admin New UI Design

The Gravity Forms settings screens and controls have been completely reworked with a modern look and feel for both layout and the standard controls. This improvement will also be worked across all our add-ons in time as well.

Settings API

We have added an API for Settings management. Stay tuned for more information on this.

Complete Revamp of CSS Styles

This version brings a major revamp of CSS styles, which have been rewritten to be far less strict. This is to make styles easier to customize and it allows the theme to control the look of the form.

For a good overview of many of the style and markup changes, refer to our Guide for Theme Developers.

Updates to Markup

The markup has been overhauled to accommodate a number of accessibility enhancements and better organization moving forward. Refer to this article for information on what has changed.

The previous Gravity Forms markup, now referred to as legacy markup, will continue to work for all old forms, but it is targeted for deprecation in a future release. For now though, existing forms will automatically use the legacy markup, while new forms created under 2.5 will use the new markup.

Using legacy markup for a newly created form can be enabled with the new legacy markup Form Setting.

Theme Integration

The Gravity Forms team has worked with a wide assortment of theme developers to help ensure that 2.5 works with many popular WordPress themes straight out of the box. That obviously does not mean they all will be, or that all themes will be updated at launch, but we are working to get the word out and ensure this beta period allows theme developers time to test and update.

Other Form Editor Enhancements

We have included drag and drop support for touch devices and an improved conditional logic UI, including a fly out menu to allow more space for complex conditional logic sequences. There have been many minor tweaks also to the form editor to enhance design, performance, and usability.

Known Limitations

Some behaviors or previous methods may need to be changed. Refer to this article for a list of possible changes or feature design decisions that may affect existing setups or behaviors.

gravity_form_enqueue_scripts()

gravity_form_enqueue_scripts()

DescriptionUsageParametersExamplesPlacementSource Code

Description

This function will enqueue the necessary styles and scripts for the specified Gravity Form. This is useful when manually embedding a form outside the WordPress loop using the function call or to force the stylesheets and scripts to load in the header when using the Form Widget.

Note: To correctly enqueue the scripts, this function must be called before wp_head

Usage

gravity_form_enqueue_scripts( $form_id, $is_ajax );

Parameters

$form_id integer
The form ID of the targeted form.

$is_ajax bool
Specify true to use ajax form submission. Default value is false.

Examples

function gf_enqueue_required_files() {
GFCommon::log_debug( __METHOD__ . '(): running.' );
if ( is_page('1') ) { // Only for a page with ID 1.
gravity_form_enqueue_scripts( 5, true ); // Form ID 5 with ajax enabled.
}
}
add_action( 'get_header', 'gf_enqueue_required_files' );

Placement

This script should be placed in the theme』s header.php file just before the wp_head() function is called.

Source Code

This filter is located in gravityforms.php

gquiz_incorrect_indicator

gquiz_incorrect_indicator

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter allows the image used when a user gets an answer incorrect on a quiz to be changed. This allows you to link to your own icon.
Usage
add_filter( 'gquiz_incorrect_indicator', 'gquiz_incorrect_indicator' );

Parameters

$incorrect_answer_indicator_url string
The link to the current image.

Examples
add_filter( 'gquiz_incorrect_indicator', 'gquiz_incorrect_indicator' );
function gquiz_incorrect_indicator ( $incorrect_answer_indicator_url ){
$incorrect_answer_indicator_url = "http://mydomain.com/incorrect.png";
return $incorrect_answer_indicator_url;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFQuiz::init() in gravityformsquiz/class-gf-quiz.php.

gquiz_correct_indicator

gquiz_correct_indicator

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter allows the image used when a user gets an answer correct on a quiz to be changed. This allows you to link to your own icon.
Usage
1add_filter( 'gquiz_correct_indicator', 'gquiz_correct_indicator' );

Parameters

$correct_answer_indicator_url string
The link to the current image.

Examples
12345add_filter( 'gquiz_correct_indicator', 'gquiz_correct_indicator');    function gquiz_correct_indicator ( $correct_answer_indicator_url ){        $correct_answer_indicator_url = "http://mydomain.com/correct.png";        return $correct_answer_indicator_url;    }
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFQuiz::init() in gravityformsquiz/class-gf-quiz.php.

gquiz_answer_indicator

gquiz_answer_indicator

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter allows the HTML markup for the answer indicator to be changed.
Usage
add_filter( 'gquiz_answer_indicator', 'gquiz_answer_indicator', 10, 7 );

Parameters

$indicator_markup string
The indicator HTML/text for an answer.

$form Form Object
The form object.

$field Field Object
The field object.

$choice
The Choice object for the quiz.

$lead Lead Object
The Lead object.

$is_response_correct bool
True or false if the response is correct; can be used to change indicators.

$is_response_wrong bool
True or false if the response is incorrect; can be used to change indicators.

Examples
add_filter( 'gquiz_answer_indicator', 'gquiz_answer_indicator', 10, 7);
function gquiz_answer_indicator( $indicator_markup, $form, $field, $choice, $lead, $is_response_correct, $is_response_wrong ) {
if ( $is_response_correct ) {
$indicator_markup = ' (you got this one right!)';
} elseif ( $is_response_wrong ) {
if ( $field['inputType'] == 'checkbox' && rgar( $choice, 'gquizIsCorrect' ) ) {
$indicator_markup = ' (you missed this one!)';
} else {
$indicator_markup = ' (you got this one wrong!)';
}
} elseif ( rgar( $choice, 'gquizIsCorrect' ) ) {
$indicator_markup = ' (this was the correct answer!)';
}
return $indicator_markup;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFQuiz::get_quiz_results() in gravityformsquiz/class-gf-quiz.php.

GFStripe

GFStripe

Descriptiongf_stripe()get_payment_feed()cancel()get_amount_export()get_amount_import()insert_feed()add_note()log_debug()log_error()include_stripe_api()

Description
GFStripe is the class which houses the main functionality of the Gravity Forms Stripe Add-on; it extends the GFPaymentAddOn class which is part of the add-on framework. Below are a few functions which you may find useful when working on your own custom code.
gf_stripe()
The gf_stripe() function is used to return an instance of the GFStripe class.
get_payment_feed()
Retrieves the feed used to process the entry object. If the Form Object is supplied and an Entry Object isn』t then the first active feed which matches conditional logic will be returned.
1$feed = gf_stripe()->get_payment_feed( $entry );

$entry Entry Object | boolean
The Entry Object to be checked.

$form Form Object | boolean
The Form Object to be used when evaluating feed conditional logic. Defaults to false.

Returns Feed Object | boolean
The feed for this entry or false.

cancel()
Cancel the Stripe subscription for the customer who was created from the supplied Entry Object.
1$result = gf_stripe()->cancel( $entry, $feed );

$entry Entry Object
The Entry Object the subscription/customer was created from.

$feed Feed Object
The Feed Object. Not currently used so you could pass false instead.

Returns boolean
True or false. Indicates if the subscription cancellation was successful.

get_amount_export()
Removes currency symbol and if required converts the amount to the smallest unit required by the gateway (e.g. dollars to cents).
1$amount = gf_stripe()->get_amount_export( $amount, $currency_code );

$amount integer | float
The value to be formatted.

$currency_code string
The currency code.

Returns integer | float
The value which can be safely passed to Stripe.

get_amount_import()
If necessary convert the amount back from the smallest unit required by the gateway, e.g. cents to dollars.
1$amount = gf_stripe()->get_amount_import( $amount, $currency_code );

$amount integer | float
The value to be formatted.

$currency_code string
The currency code.

Returns integer | float
The formatted value.

insert_feed()
The insert_feed() method can be used to add Stripe feeds.
1$feed_id = gf_stripe()->insert_feed( $form_id, $is_active, $meta );

$form_id integer
The ID of the form this feed will be used with.

$is_active boolean
Is this feed active or inactive.

$meta Stripe Feed Meta
An associative array containing the properties which determine the type of transaction which will occur when the feed is processed.

Returns integer
The ID of the new feed.

add_note()
Add a note to the specified Entry.
1gf_stripe()->add_note( $entry_id, $note, $note_type );

$entry_id integer
The ID of the Entry this note should be added to.

$note string
The note to be added.

$note_type string
The type of note to be added. Example values: note, success, or error.

log_debug()
Writes a debug message to the log file for the Stripe Add-On. Requires the Logging Add-On.
1gf_stripe()->log_debug( $message );

$message string
The message to be written to the Stripe log.

log_error()
Writes an error message to the log file for the Stripe Add-On. Requires the Logging Add-On.
1gf_stripe()->log_error( $message );

$message string
The message to be written to the Stripe log.

include_stripe_api()
Include the Stripe API.
1gf_stripe()->include_stripe_api();