Created
March 9, 2018 16:19
-
-
Save woogists/488bcc6c0e7611bad12a37b36452e04b to your computer and use it in GitHub Desktop.
[WooCommerce Bookings] Modify the date in a booking’s summary
This file contains 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
/** | |
* wc_bookings_summary_list_date is used to filter a booking's summary date. | |
* This example removes the end date for a multi-day booking. | |
* | |
* @param string $booking_date The formatted date that is displayed by default. | |
* @param int $booking_start Timestamp for the booking start time/date. | |
* @param int $booking_end Timestamp for the booking end time/date. | |
* @return string The modified date string. | |
*/ | |
function modify_summary_date_20170821( $booking_date, $booking_start, $booking_end ) { | |
return date( 'F j, Y', $booking_start ); | |
} | |
add_filter( 'wc_bookings_summary_list_date', 'modify_summary_date_20170821', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can I use this to force it to show booking start time and end time.. currently it only shows end time/date if the end date is on a different day than start date