Use All Fields Template for Nested Entries Output

Use the default configured All Fields Template (see: https://gravitywiz.com/gravity-forms-all-fields-template/) when displaying child entries in Nested Form fields via the {all_fields} and Nested Form field merge tags.

Code

Filename: gpnf-use-all-fields-template-for-nested-entries.php

<?php
/**
 * Gravity Perks // Nested Forms // Use All Fields Template for Nested Entries Output
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * Use the default configured All Fields Template (see: https://gravitywiz.com/gravity-forms-all-fields-template/) when
 * displaying child entries in Nested Form fields via the {all_fields} and Nested Form field merge tags.
 */
add_filter( 'gp_template_output_nested-entry', function( $output, $template, $load, $args ) {
	return gw_all_fields_template()->replace_merge_tags( "{all_fields:{$args['modifiers']}}", $args['nested_form'], $args['entry'], false, false, false, 'html' );
}, 10, 4 );

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.