Blocking multiple bookings for a reserved date is essential for managing reservations effectively. By implementing a robust booking system with real-time updates and clear user feedback, you can prevent overbooking. This will ensure a smooth experience for your customers.

To effectively manage reservations and prevent overbooking, WP Travel v9.1.0 introduces a new hook that allows you to block bookings for specific dates under various conditions.

Blocking All Trips for a Specific Date

To block all trips on a particular date, you can add the following code in the functions.php file of your child theme or simply you can add it through code snippets.

add_filter('wp_travel_enable_booking_reserve_date', function() {
    return true;
});

Note: Please note that the above code will only work when the WP Travel Pro plugin is activated.

For detailed information on creating a child theme, please refer to our KnowledgeBase.

You may find this useful: How To Add Exclude Dates For All The Trips?

Blocking Specific Trips for a Specific Date

If you need to block bookings for specific trips on a particular date, you can use the following code in the functions.php file of your child theme. You can also simply add it through code snippets.

add_filter('wp_travel_enable_booking_reserve_date', function() {
    return true;
});

add_filter('wp_travel_enable_booking_reserve_date_all_trips', function() {
    return false;
});

Note: Please note that the above code will only work when the WP Travel Pro plugin is activated.

Learn more: How to block booking before a specific date?

By implementing these snippets, you can block multiple bookings for a reserved date. This helps to efficiently manage your reservations and prevent multiple bookings on dates when trips are already reserved.