Description
The gform_disable_form_theme_css filter allows the default theme used by forms created with Gravity Forms 2.5 and greater to be disabled.
Note: This filter only disables the CSS for the Gravity Theme, and does not impact the Orbital Theme. To disable the styles for the Orbital Theme, use the gform_disable_css filter.
Usage
The filter which would run for all forms would be used like so:
add_filter( 'gform_disable_form_theme_css', 'your_function_name' );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $disabled | bool | Whether to disable the theme css. |
Examples
1. Disable the Gravity Theme.
add_filter( 'gform_disable_form_theme_css', '__return_true' );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFFormDisplay::get_form_enqueue_assets() in form_display.php.