Created
March 15, 2018 13:54
-
-
Save WillBrubaker/5f68faf90dc9c164234326725e0fa15f to your computer and use it in GitHub Desktop.
WooCommerce Bookings: Remove all available blocks for the day if one is booked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Don't know what to do with this? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
| add_filter( 'wc_bookings_product_get_available_blocks', 'beardedguy_maybe_remove_availability', 10, 5 ); | |
| function beardedguy_maybe_remove_availability( $available_blocks, $booking_object, $blocks, $intervals, $resource_id ) { | |
| return ( sizeof( $available_blocks ) < sizeof( $blocks ) ) ? array() : $available_blocks; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment