Description
The filter gform_disable_css
can be used to disable all CSS files from being loaded on the frontend.
This includes styles which handle conditional logic, columns, hidden fields, ready classes, etc.
Usage
add_filter( 'gform_disable_css', 'your_function_name' );
Parameters
-
$is_css_disabled bool
Indicates if CSS files are to be loaded by Gravity Forms. Default is false.
Example
Disable loading of CSS files
This example would disable all loading of CSS files for all forms.
add_filter( 'gform_disable_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.8.
Source Code
This filter is located in form_display.php and includes/blocks/class-gf-block-form.php and
includes/form-display/class-gf-form-display-service-provider.php and
includes/system-status/class-gf-system-report.php.