gform_bypass_template_library

Description

The gform_bypass_template_library filter can be used to bypass the template library when creating new forms.

Usage

Applies to all forms:

add_filter( 'gform_bypass_template_library', 'your_function_name' );

Parameters

  • $is_bypassed bool
    Whether or not the template library should be bypassed.

Examples

Always bypass template library

This example shows how to always bypass the template library when creating new forms.

add_filter( 'gform_bypass_template_library', '__return_true' );

Show template library for one specific user

This example shows how to show the template library for only one user (and bypass for other users.)

add_filter( 'gform_bypass_template_library', function() {
    return wp_get_current_user()->user_login !== 'armstrong' ;
} );

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 2.9

Source Code

This filter is located in class GF_Template_Library_Config in /includes/template-library/config/class-gf-template-library-config.php.