Disabling Passthrough With Query Parameter

Code

Filename: gpep-disable-passthrough-with-query-parameter.php

<?php
/**
 * Gravity Perks // Easy Passthrough // Disabling Passthrough With Query Parameter
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 */
add_filter( 'gpep_field_values', function( $field_values, $form_id ) {
	// If passthrough=0 is in the query parameters, return an empty array.
	if ( '0' == rgget( 'passthrough' ) ) {
		return array();
	}
	return $field_values;
}, 10, 2 );

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.