gpnf_item_labels

  1. Description
  2. Usage
  3. Parameters
  4. Example
    1. Set custom labels.
  5. Since

Description

Filter the label used to identify entries in a Nested Form field.

Usage

Apply to all forms and fields.

add_filter( 'gpnf_item_labels', 'my_custom_function' );

Apply to all fields for a specific form.

add_filter( 'gpnf_item_labels_FORMID', 'my_custom_function' );

Apply to a specific form and field.

add_filter( 'gpnf_item_labels_FORMID_FIELDID', 'my_custom_function' );

Parameters

  • item_labels array

    • singular string

      Label used to identify a single entry (e.g. car).

    • plural string

      Label used to identify more than one entry (e.g. cars).

Example

Set custom labels.

Set custom labels for both singular and plural values. This overrides any setting made in the Nested Form field settings.

add_filter( 'gpnf_item_labels', function() {
    return array(
        'singular' => __( 'employee', 'gravityperks' ),
        'plural'   => __( 'employees', 'gravityperks' )
    );
} );

Since

This filter is available since Gravity Forms Nested Forms 1.0.