gform_force_hooks_js_output

gform_force_hooks_js_output

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description

The gform_force_hooks_js_output filter can be used to prevent the Gravity Forms scripts from being injected into the pages if they』re not necessary.

Usage

1add_filter( 'gform_force_hooks_js_output', 'your_function_name' );

Parameters

Defaults to true. Set to false using __return_false or a custom function to set to false.

Examples

1add_filter( 'gform_force_hooks_js_output', '__return_false' );

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in Gravity Forms version 2.5.3.1.

Source Code

This filter is located in Gravity_FormsGravity_FormsLibrariesDom_Parser::get_injected_html() in includes/libraries/class-dom-parser.php and GFForms::localize_hook_vars() in gravityforms.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注