gpb_customer_name_field

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Use a specific field ID as the customer name field for a form.

Description

Filter the form field ID used to resolve the customer name.

Usage

Applied globally

add_filter( 'gpb_customer_name_field', 'my_custom_function' );

Parameters

$field_id int|string|null

The field ID to use. Defaults to the first Name field ID, or null.

$form array

The Gravity Forms form array.

$entry array

The Gravity Forms entry array.

$booking Booking

The booking instance.

Examples

Use a specific field ID as the customer name field for a form.

add_filter( 'gpb_customer_name_field', function ( $field_id, $form ) {
    if ( (int) ( $form['id'] ?? 0 ) === 123 ) {
        return 4;
    }
    return $field_id;
}, 10, 2 );