CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 10:20:45 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=orAwjtb8ugTZUVEAB2hpIMtKF72Hw%2F%2FWN5nTft7nOcjrL0XCX9CLfWtYN2jddWEiZTBn%2BNdFBo4v%2B59nv3dp3Y9dsCsIQYoWOKZ9XNFGxBOUjjed"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 98d5ddc69ba3c1c2-BLR
gform_footer_init_scripts_filter - Gravity Forms Documentation
gform_footer_init_scripts_filter
Description
Allows the scripts that fire in the footer to be modified.
Note: The gform_init_scripts_footer must be set to true so scripts are initialized in the footer of the site instead of the page body.
Usage
The following would apply to all forms:
add_filter( 'gform_footer_init_scripts_filter', 'your_function_name', 10, 3 );
To target a specific form, append the form id to the hook name. (format: gform_footer_init_scripts_filter_FORMID)
add_filter( 'gform_footer_init_scripts_filter_1', 'your_function_name', 10, 3 );
Parameters
- $form_string string
A string of the scripts used in the footer.
<script type='text/javascript'> jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 75) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} );</script><script type='text/javascript'> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [75, 1]) } ); </script>
-
$form Form Object
The current form.
-
$current_page int
The ID of the current page.
Example
add_filter( 'gform_footer_init_scripts_filter', 'filter_footer', 10, 3 ); function filter_footer( $form_string, $form, $current_page ){ $form_string .= "<script type='text/javascript'>alert('Hello');</script>"; return $form_string; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 1.8.4.
Source Code
This filter is located in GFFormDisplay::footer_init_scripts() in form_display.php.