gpb_default_status
Description
Filters the default booking status.
Usage
Applied globally
add_filter( 'gpb_default_status', 'my_custom_function' );Parameters
$status
string
The default booking status from settings.
$bookable
Bookable|null
The bookable object being booked.
$entry
array|null
The GF entry array.
Examples
Set different default statuses by Service ID.
add_filter( 'gpb_default_status', function( $status, $bookable, $entry ) {
if ( ! $bookable ) {
return $status;
}
$service_statuses = [
10 => 'confirmed',
13 => 'pending',
];
return $service_statuses[ $bookable->get_id() ] ?? $status;
}, 10, 3 );Since
1.0-beta-1.5Hook added.