Relax Template Cache To Not Include Field ID

Code

Filename: gppa-relax-template-cache.php

<?php
/**
 * Gravity Perks // GP Populate Anything // Relax Template Cache To Not Include Field ID
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_process_template_cache_key', function( $cache_key, $field, $object, $template, $template_name, $object_type, $primary_property ) {
	return serialize(
		array(
			$template,
			$object_type->get_object_id( $object, $primary_property ),
		)
	);
}, 10, 7 );

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.