gpb_max_duration
Description
Filter the maximum booking duration. This can be used to change the enforced maximum for a role or other request context without changing the Service setting.
Usage
Applied globally
add_filter( 'gpb_max_duration', 'my_custom_function' );Parameters
$max_duration
int|null
The configured maximum duration in minutes.
$service
Service
The service object.
Examples
Allow administrators to bypass the configured maximum duration.
add_filter( 'gpb_max_duration', function( $max_duration, $service ) {
if ( ! current_user_can( 'manage_options' ) ) {
return $max_duration;
}
return null;
}, 10, 2 );Since
1.1Hook added.