gpb_bookable_name

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Change the display name
  5. Since

Description

Filter the display name of a service or resource by ID.

Usage

Applied globally

add_filter( 'gpb_bookable_name', 'my_custom_function' );

Applied to specific form

add_filter( 'gpb_bookable_name_FORMID', 'my_custom_function' );

Parameters

$name string

The current name.

$id int

The post ID of the service/resource.

$bookable Bookable

The bookable object.

Examples

Change the display name

add_filter( 'gpb_bookable_name', function( $name, $id, $bookable ) {
    if ( $id === 123 ) {
        $name = 'Custom Name';
    }
    return $name;
}, 10, 3 );

Since

  • 1.0-beta-2.4 Hook added.