gpnf_child_entries_separator

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Set Custom Separator
  5. Since

Description

Filter the separator between child entry summaries when displaying all child entries either in {all_fields} merge tag or a specific Nested Form field’s merge tag.

Defaults to an <hr> when the output format is “html”.

Usage

Apply to all Nested Form fields on all forms.

add_filter( 'gpnf_child_entries_separator', 'my_custom_function' );

Apply to all Nested Form fields on a specific form.

add_filter( 'gpnf_child_entries_separator_FORMID', 'my_custom_function' );

Apply to a specific Nested Form field on a specific form.

add_filter( 'gpnf_child_entries_separator_FORMID_FIELDID', 'my_custom_function' );

Parameters

  • hr string

    The horizontal rule to be used.

  • field \GP_Nested_Form_Field

    The current Nested Form field object.

  • format string

    The format in which the child entries will be displayed (‘html’ or ‘text’).

Examples

Set Custom Separator

Use “—” to separate child entries rather than the default <hr>.

<?php
/**
 * Gravity Perks // Nested Forms // Set Custom Separator
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * By default, an <hr> is used to separate child entries rendered via the {all_fields} merge tag
 * and the Nested Form field merge tag. Use this snippet to customize the separator.
 */
add_filter( 'gpnf_child_entries_separator', function() {
	// Update this value to any characters or HTML you would like to use as a separator.
	return '---';
} );

Since

This filter is available since Gravity Forms Nested Forms 1.0.