Last active
November 28, 2022 10:01
-
-
Save pramodjodhani/8e470839c7cef8441c0311c406970754 to your computer and use it in GitHub Desktop.
Modify format of the selected date at Reservation Table.
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
| <?php | |
| /** | |
| * Modify format of the selected date at Reservation Table. | |
| * Remove st, th, etc suffix. | |
| * | |
| * @param array $dates Dates. | |
| */ | |
| function iconic_wds_modify_date_format_reservation_table( $dates, $format ) { | |
| if ( ! wp_doing_ajax() ) { | |
| return $dates; | |
| } | |
| if ( 'array' !== $format ) { | |
| return $dates; | |
| } | |
| foreach ( $dates as &$date ) { | |
| $date['formatted'] = date_i18n( 'D, j M', $date['timestamp'] ); | |
| } | |
| return $dates; | |
| } | |
| add_action( 'iconic_wds_available_dates', 'iconic_wds_modify_date_format_reservation_table', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment