That’s interesting, thank you for your request!
I have added this feature in the development schedule, but the development priority are set according to the number of requests.
For now, you can add it with the API:
Add this code in your child theme functions.php:
/**
* Add the "Delivered" booking status
* @param array $labels_array
* @return array
*/
function my_theme_booking_states_labels_array( $labels_array ) {
$labels_array[ 'delivred' ] = array( 'display_state' => 'good', 'label' => __( 'Delivered', 'my_theme_text_domain' ) );
return $labels_array;
}
add_filter( 'bookacti_booking_states_labels_array', 'my_theme_booking_states_labels_array', 20, 1 );
/**
* Allow to manually change the "Delivered" booking status
* @param array $labels_array
* @return array
*/
function my_theme_booking_states_you_can_manually_change( $status_array ) {
$status_array[ 'delivred' ] = __( 'Delivered', 'my_theme_text_domain' );
return $status_array;
}
add_filter( 'bookacti_booking_states_you_can_manually_change', 'my_theme_booking_states_you_can_manually_change', 10, 1 );
/**
* Flag the "delivered" booking status as active
* @param array $status
* @return array
*/
function my_theme_active_booking_states( $status ) {
$status[] = 'delivered';
return $status;
}
add_filter( 'bookacti_active_booking_states', 'my_theme_active_booking_states', 20, 1 );
/**
* Allow only administrators to change a booking state to "delivered"
* @param boolean $true
* @param int $booking_id
* @param string $new_state
* @return boolean
*/
function my_theme_booking_state_can_be_changed( $true, $booking_id, $new_state ) {
if( ! $true || $new_state !== 'delivered' ) { return $true; }
return current_user_can( 'bookacti_edit_bookings' );
}
add_filter( 'bookacti_booking_group_state_can_be_changed', 'my_theme_booking_state_can_be_changed', 20, 3 );
add_filter( 'bookacti_booking_state_can_be_changed', 'my_theme_booking_state_can_be_changed', 20, 3 );
Regards,
Yoan Cutillas