gpnf_parent_entry_link_template

  1. Description
  2. Usage
  3. Parameters
  4. Example
    1. Modify the label from “Parent Entry” to “Main Booking”.
    2. Converts the whole template into a button.
  5. Since

Description

Filters the template used to render the parent entry link.

Usage

add_filter( 'gpnf_parent_entry_link_template', 'my_custom_function' );

Parameters

  • template string

    The format string used to generate the parent entry link.

  • label string

    The label for the parent entry (default: “Parent Entry”).

  • parent_entry_id int

    The ID of the parent entry.

  • parent_entry_url string

    The URL of the parent entry detail view.

Example

Modify the label from “Parent Entry” to “Main Booking”.

add_filter( 'gpnf_parent_entry_link_template', function( $template, $label, $entry_id, $url ) {
	return sprintf( $template, 'Main Booking', $entry_id, $url );
}, 10, 4 );

Converts the whole template into a button.

add_filter( 'gpnf_parent_entry_link_template', function( $template, $label, $entry_id, $url ) {
	return '<button onclick="window.location.href=\'' . esc_url( $url ) . '\'">' . esc_html( $label ) . ': ' . esc_html( $entry_id ) . '</button>';
}, 10, 4 );

Since

This filter is available since Gravity Forms Nested Forms 1.2.4.