gform_is_valid_conditional_logic_operator

gform_is_valid_conditional_logic_operator

DescriptionUsageParametersSinceSource Code

Description
Filter which checks whether the operator is valid. Allows custom operators to be validated.
Usage
add_filter( 'gform_is_valid_conditional_logic_operator', 'your_function_name', 10, 2 );

Parameters

$is_valid bool
Whether the operator is valid or not.

$operator string
The conditional logic operator.

Since
This filter was added in Gravity Forms 2.0.7.20.
Source Code
This filter is located in forms_model.php.

gform_is_ssl

gform_is_ssl

DescriptionUsageExamplesPlacementSource Code

Description
Use this filter to determine whether or not the current page is running securely (https). Useful when using a proxy server that does not set the $_SERVER[『HTTPS』] variable.
Usage
1add_filter( 'gform_is_ssl', '__return_true' );
Examples
1add_filter( 'gform_is_ssl', '__return_true' );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFCommon::is_ssl() in common.php

gform_is_form_editor

gform_is_form_editor

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows pages to be marked as Form Editor pages or not.
Usage
add_filter( 'gform_is_form_editor', 'your_function_name', 10, 1 );

Parameters

$is_form_editor bool
Whether the page is a form editor page or not.

Example
add_filter( 'gform_is_form_editor', 'set_editor', 10, 1 );
function set_editor( $is_form_editor ){
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 1.9.9.
Source Code
This filter is located in GFCommon::is_form_editor() in common.php.

gform_is_feed_asynchronous

gform_is_feed_asynchronous

DescriptionUsageParametersPlacementSource Code

Description
In some cases, you may want to process a feed asynchronously. The gform_is_feed_asynchronous filter will allow you to do so.
Usage
The following would apply to all forms.
1add_filter( 'gform_is_feed_asynchronous', '__return_true' );

Parameters

$is_asynchronous bool
Is feed being processed asynchronously?

$feed array
The Feed Object currently being processed.

$form array
The Form Object currently being processed.

$entry array
The Entry Object currently being processed.

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in class-gf-feed-addon.php.

gform_is_entry_detail

gform_is_entry_detail

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the Entry Edit or Entry Detail Edit pages to be marked as a regular page, not an admin or edit page, or a regular page to be marked as an Entry Detail page. This filter is useful if you are creating custom entry edit pages.
Usage
1add_filter( 'gform_is_entry_detail', 'your_function_name', 10, 1 );

Parameters

$is_entry_detail bool
Whether the current page is the Entry Detail Edit (entry_detail_edit) page or the Entry Edit (entry_detail) page.

Example
1234add_filter( 'gform_is_entry_detail', 'set_entry_edit', 10, 1 );function set_entry_edit( $is_entry_detail ){    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 1.9.9.
Source Code
This filter is located in GFCommon::is_entry_detail() in common.php.

gform_is_entry_detail_view

gform_is_entry_detail_view

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the 「entry_detail」 page to be marked as a regular page, not an admin or edit page, or a regular page to be marked as an Entry Detail page. This filter is useful if you are creating custom entry edit pages.
Usage
add_filter( 'gform_is_entry_detail_view', 'your_function_name', 10, 1 );

Parameters

$is_entry_detail_view bool
Whether the current page is the Entry Detail (entry_detail) page.

Example
add_filter( 'gform_is_entry_detail_view', 'set_entry_edit', 10, 1 );
function set_entry_edit( $is_entry_detail_view ){
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 1.9.9.
Source Code
This filter is located in GFCommon::is_entry_detail_view() in common.php.

gform_is_entry_detail_edit

gform_is_entry_detail_edit

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the 「entry_detail_edit」 page to be marked as a regular page, not an admin or edit page, or a regular page to be marked as an Entry Detail Edit page. This filter is useful if you are creating custom entry edit pages.
Usage
add_filter( 'gform_is_entry_detail_edit', 'your_function_name', 10, 1 );

Parameters

$is_entry_detail_edit bool
Whether the current page is the Entry Detail Edit (entry_detail_edit) page.

Example
add_filter( 'gform_is_entry_detail_edit', 'set_entry_edit', 10, 1 );
function set_entry_edit( $is_entry_detail_edit ){
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 1.9.9.
Source Code
This filter is located in GFCommon::is_entry_detail_edit() in common.php.

gform_is_encrypted_field

gform_is_encrypted_field

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Determines if an entry field is stored encrypted. Use this hook to change the default behavior of decrypting fields that have been encrypted or to completely disable the process if checking for encrypted fields.
Usage
1add_filter( 'gform_is_encrypted_field', 'your_function_name', 10, 2 );

Parameters

$is_encrypted string
Defaults to 」

$entry_id int
The current Entry ID.

$field_id int
he current Field ID.

Example
1234add_filter( 'gform_is_encrypted_field', 'not_encrypted', 10, 3 );function not_encrypted( $is_encrypted, $entry_id, $field_id ){    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 1.9.14.
Source Code
This filter is located in:
GFFormsModel::is_encrypted_field() in forms_model.php
GFFormsModel::is_openssl_encrypted_field() in forms_model.php.

gform_is_duplicate

gform_is_duplicate

DescriptionUsageParametersExamples1. Check if email already registered2. Use GFAPI::count_entriesSource Code

Description
This filter is executed during the validation of fields marked with the 「No Duplicates」 rule. Use this hook to specify a custom duplicate validation logic.
Usage
The following would apply to all forms:
add_filter( 'gform_is_duplicate', 'your_function_name', 10, 4 );

To target a specific form append the form id to the hook name. (Format: gform_is_duplicate_FORMID)
add_filter( 'gform_is_duplicate_5', 'your_function_name', 10, 4 );

Parameters

$count integer
The number of duplicate entries. Filtering this value to 0 means there are no duplicates.

$form_id integer
The current form』s id.

$field Field Object
The current field being validated

$value string
The value of the current field

Examples
1. Check if email already registered
This example checks to see if the email address is already in use. If so, consider the email a duplicate and return a count of 1; otherwise return a count of 0.
add_filter( 'gform_is_duplicate', 'noDuplicateEMails', 10, 4 );
function noDuplicateEMails( $count, $form_id, $field, $value ) {
if ( $field->type == 'email' && get_user_by( 'email', $value ) ) {
return 1;
} else {
return 0;
}
}

2. Use GFAPI::count_entries
This example uses the GFAPI::count_entries() method, for form ID 1, to get a count of entries which have a payment_status of Paid and contain the submitted value for field ID 2.
add_filter( 'gform_is_duplicate_1', function ( $count, $form_id, $field, $value ) {
if ( $field->id == 2 && $count ) {
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
array(
'key' => 'payment_status',
'value' => 'Paid',
),
array(
'key' => '2',
'value' => $value,
),
),
);

$count = GFAPI::count_entries( $form_id, $search_criteria );
}

return $count;
}, 10, 4 );

Source Code
This filter is located in GFFormsModel::is_duplicate() in forms_model.php

gform_is_delayed_pre_process_feed

gform_is_delayed_pre_process_feed

DescriptionUsageParametersExamples1. Delay Feeds For Most Add-Ons2. Skip User Registration For Logged In Users3. Delay AWeber Feeds Until After Notifications/Confirmations4. Delay Mailchimp Feeds Until After User Registration5. Delay Slack Feeds Until Mid User RegistrationPlacementSource CodeSince

Description
This filter can be used to delay feed processing for Add-On Framework based add-ons.
Usage
The base filter which would run for all forms and all feeds would be used like so:
add_filter( 'gform_is_delayed_pre_process_feed', 'your_function_name', 10, 4 );

To target a specific form append the form id to the hook name. (format: gform_is_delayed_pre_process_feed_FORMID)
add_filter( 'gform_is_delayed_pre_process_feed_10', 'your_function_name', 10, 4 );

Parameters

$is_delayed boolean
Is feed processing delayed?

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$slug string
The add-on slug, including the gravityforms prefix. See the Gravity Forms Add-On Slugs article for a list of possible slugs.

Examples
1. Delay Feeds For Most Add-Ons
This is just a quick example showing how you can delay all feeds except those for the Stripe and Mailchimp Add-Ons. You would need to perform some logic to determine if the feeds should actually be delayed, e.g. has payment been made. If you don』t, the feed would remain delayed when you trigger feed processing after your event has occurred.
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_feeds', 10, 4 );
function maybe_delay_feeds( $is_delayed, $form, $entry, $slug ) {
$not_delayed = array( 'gravityformsmailchimp', 'gravityformsstripe' );

return ! in_array( $slug, $not_delayed );
}

2. Skip User Registration For Logged In Users
This example prevents the User Registration 『create』 feed running if the user is logged in. Read the full tutorial for details and the second part of the code snippet.
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_feeds', 10, 4 );
function maybe_delay_feeds( $is_delayed, $form, $entry, $slug ) {
if ( is_user_logged_in() && $slug == 'gravityformsuserregistration' ) {
return gf_user_registration()->has_feed_type( 'create', $form );
}
return $is_delayed;
}

3. Delay AWeber Feeds Until After Notifications/Confirmations
This example shows how you can delay AWeber feed processing until the end of the submission process, after notifications and confirmations have been processed.
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_aweber_feeds', 10, 4 );
function maybe_delay_aweber_feeds( $is_delayed, $form, $entry, $slug ) {
if ( $slug == 'gravityformsaweber' ) {
$fulfilled = gform_get_meta( $entry['id'], $slug . '_is_fulfilled' );
$processed = gform_get_meta( $entry['id'], 'processed_feeds' );

return empty( $fulfilled ) && rgempty( $slug, $processed );
}

return $is_delayed;
}

4. Delay Mailchimp Feeds Until After User Registration
This example shows how you can delay Mailchimp feed processing if a user hasn』t been created from the entry. To process the feed when the user is created would also require using the gform_user_registered hook.
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_mailchimp_feeds', 10, 4 );
function maybe_delay_mailchimp_feeds( $is_delayed, $form, $entry, $slug ) {
if ( $slug == 'gravityformsmailchimp' && function_exists( 'gf_user_registration' ) ) {
$user_id = gf_user_registration()->get_user_by_entry_id( $entry['id'], true );

return rgblank( $user_id );
}

return $is_delayed;
}

5. Delay Slack Feeds Until Mid User Registration
This example shows how you can delay Slack feed processing if a pending activation does not exist for the current entry. To process the feed when the user activation key is available would also require using the gform_gravityformsuserregistration_post_process_feed hook.
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_slack_feeds', 10, 4 );
function maybe_delay_slack_feeds( $is_delayed, $form, $entry, $slug ) {
if ( $slug == 'gravityformsslack' && function_exists( 'gf_user_registration' ) ) {
$activation_key = gform_get_meta( $entry['id'], 'activation_key' );

return rgblank( $activation_key );
}

return $is_delayed;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_is_delayed_pre_process_feed', $form['id'], $is_delayed, $form, $entry, $this->_slug )

This filter is located in GFFeedAddOn::maybe_process_feed() in includes/addon/class-gf-feed-addon.php.
Since
This filter was added in Gravity Forms 1.9.13.24.