Description
The gform_enable_legacy_markup filter can be used to enable the legacy markup for forms created with Gravity Forms 2.5 and greater.
Usage
add_filter( 'gform_enable_legacy_markup', 'your_function_name', 10, 2 );
You can also specify this per form by adding the form id after the filter name.
add_filter( 'gform_enable_legacy_markup_6', 'your_function_name', 10, 2 );
Parameters
- $is_enabled boolean
Indicates if legacy markup is enabled for the current form. Default is false for forms created with Gravity Forms 2.5 and greater.
-
$form Form Object
The current form object.
Examples
1. Enable legacy markup for all forms
add_filter( 'gform_enable_legacy_markup', '__return_true' );
2. Disable legacy markup for all forms
add_filter( 'gform_enable_legacy_markup', '__return_false' );
Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFCommon::is_legacy_markup_enabled() in common.php.