Change Template for GravityView Entry List View

Code

Filename: gpnf-change-template-for-gravityview-entry-list-view.php

<?php
/**
 * Gravity Perks // Nested Forms // Change Template for GravityView Entry List View
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 */
// Update "123" to your form ID and "4" to your field ID.
add_filter( 'gpnf_template_args_123_4', function ( $args, $field ) {

	if ( gravityview()->request->is_view() && ( ! gravityview()->request->is_entry() || ! gravityview()->request->is_edit_entry() ) ) {
		// Specify the template you would like to use.
		$args['template'] = 'nested-entries-detail-simple';
	}

	return $args;
}, 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.