Prioritize Token over User Passthrough

Code

Filename: gpep-prioritize-token.php

<?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;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.