gpep_bypass_session_init

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

Description

Prevent session manager from initializing on page load.

Usage

add_filter( 'gpep_bypass_session_init', '__return_true' );

Parameters

  • bypass_session_init bool

    Bypass initializing session manager.

Examples

Disable Passing Through Entries Without a Token

This example will prevent GPEP from passing through entries if the ep_token is not present in the URL.

<?php
/**
 * Gravity Perks // Easy Passthrough // Disable Passing Through Entries Without a Token
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 */
add_filter( 'gpep_bypass_session_init', function() {
	if ( ! rgget( 'ep_token' ) || ! gp_easy_passthrough()->get_entry_for_token( rgget( 'ep_token' ) ) ) {
		$session = gp_easy_passthrough()->session_manager();
		$session->reset();
	}
} );

Since

This filter is available since Gravity Forms Easy Passthrough 1.1.8.