CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 18:39:28 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: MISS
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=CNq177EekjGZv8VZu2ayYpqksVHZio6ATewZTKkDnNRBpvDoaI7syf4%2BMbDrfhGmI2fSd%2FU5d%2BmnwujMOCleNo3vjcbZgKWMXWajodp5LgNoyfvR"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 98e0f5adbd79165e-BLR
gform_disable_print_form_scripts - Gravity Forms Documentation
gform_disable_print_form_scripts
Description
This filter can be used to prevent scripts and stylesheets being printed when GFCommon::gform_do_shortcode() processes form shortcodes located in various form settings and confirmations after headers have been sent. Scripts and stylesheets would be enqueued instead.
Usage
The following would apply to all forms.
add_filter( 'gform_disable_print_form_scripts', 'your_function_name' );
Parameters
- $disable_print_form_script bool
Should printing of the scripts and stylesheets be disabled? Default is false.
-
$form Form Object
The form object for the shortcode being processed.
-
$is_ajax bool
Indicates if ajax was enabled on the shortcode.
Examples
1. Disable printing of scripts and stylesheets for all forms
add_filter( 'gform_disable_print_form_scripts', '__return_true' );
2. Target a specific form
add_filter( 'gform_disable_print_form_scripts', 'disable_print_form_scripts', 10, 2 ); function disable_print_form_scripts( $disable_print_form_script, $form) { if ( $form['id'] == 10 ) { return true; } return $gform_disable_print_form_scripts; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.0.
Source Code
This filter is located in GFCommon::gform_do_shortcode() in common.php.