gpep_disable_same_form_passthrough

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Disable Passing Through Entries Without a Token
  5. Since

Description

Filter whether GPEP should disable passing through an entry if the source and target forms are the same.

Usage

Apply to all forms using GP Easy Passthrough.

add_filter( 'gpep_disable_same_form_passthrough', 'my_custom_function' );

Apply to a specific form using GP Easy Passthrough.

add_filter( 'gpep_disable_same_form_passthrough_FORMID', 'my_custom_function' );

Parameters

  • $disable_same_form_passthrough bool

    Do not pass through entries on the same form (Default: false)

  • form array

    The current GF form array

Examples

Disable Passing Through Entries Without a Token

This example will prevent GPEP from continuously passing through entries if the ep_token is not present in the URL and the source and target forms are the same.

<?php
/**
 * Gravity Perks // Easy Passthrough // Disable Same Form Passthrough Without a Token
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 *
 * This example will prevent GPEP from continuously passing through entries if the `ep_token` is
 * not present in the URL and the source and target forms are the same.
 */
add_filter('gpep_disable_same_form_passthrough', function( $disable ) {
	if ( ! rgget( 'ep_token' ) ) {
		$disable = true;
	}
	return $disable;
});

Since

This filter is available since GP Easy Passthrough 1.9.6.