gpep_active_feeds

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Prioritize Token over User Passthrough

Description

Filter active Easy Passthrough feeds when fetched.

Usage

Apply to Easy Passthrough feeds for all forms.

add_filter( 'gpep_active_feeds', 'my_custom_function' );

Apply to Easy Passthrough feeds for a specific form.

add_filter( 'gpep_active_feeds_FORMID', 'my_custom_function' );

Parameters

  • feeds array

    All active Easy Passthrough feeds.

  • form_id int|null

    The form ID for which feeds are being fetched.

Since

This filter is available since Gravity Forms Easy Passthrough 1.9.12.

Examples

Prioritize Token over User Passthrough

<?php
/**
 * Gravity Perks // Easy Passthrough // Prioritize Token over User Passthrough
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 */
add_filter( 'gpep_active_feeds', function( $feeds ) {

	if ( ! is_user_logged_in() || ! rgget( 'ep_token' ) ) {
		return $feeds;
	}

	foreach ( $feeds as &$feed ) {
		$feed['meta']['userPassthrough'] = false;
	}

	return $feeds;
} );