gform_has_conditional_logic

Description

The gform_has_conditional_logic filter allows you to determine whether a form contains conditional logic rules.

Usage

This filter is global; it does not support the _FORMID suffix.

add_filter( 'gform_has_conditional_logic', 'your_function_name', 10, 2 );

Parameters

ParameterTypeDescription
$has_conditional_logicboolTrue or False if the user has enabled conditional logic in the current form settings
$formarrayThe current form object

Examples

Returns if the form has conditional logic.

add_filter( 'gform_has_conditional_logic', function( $has_conditional_logic, $form ) {
    return $has_conditional_logic;
}, 10, 2 );

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?

Source Code

This filter is located in GFFormDisplay::has_conditional_logic() in form_display.php.