gform_entry_meta_pre_evaluate_conditional_logic

Description

Enables customization of the entry meta supported for use with conditional logic before the rules are evaluated.

Usage

Applies to all forms:

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

Parameters

  • $entry_meta array
    The entry meta that is supported for use with conditional logic.
  • $form Form Object
    The form currently being processed.

Examples

Configure a Webhook feed Conditional Logic

The following examples allow configuring Webhook feed conditional logic based on the entry Source URL property.

Add gform_entry_meta_pre_evaluate_conditional_logic filter settings.

1
2
3
4
5
add_filter( 'gform_entry_meta_pre_evaluate_conditional_logic', function ( $entry_meta, $form ) {
    $entry_meta['source_url'] = array();
 
    return $entry_meta;
}, 10, 2 );

Add gform_entry_meta_pre_render_feed_settings filter settings.

1
2
3
4
5
6
7
8
9
10
11
12
add_filter( 'gform_entry_meta_pre_render_feed_settings', function ( $entry_meta, $form, $addon ) {
    if ( $addon->get_slug() === 'gravityformswebhooks' ) {
        $entry_meta['source_url'] = array(
            'label'  => 'Source URL,
            'filter' => array(
                'operators' => array( 'is', 'isnot', '>', '<', 'contains' ),
            ),
        );
    }
 
    return $entry_meta;
}, 10, 3 );

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 GFCommon::evaluate_conditional_logic() in common.php.

Since

The filter was added in Gravity Forms 2.9