Created
August 22, 2014 15:17
-
-
Save jazbek/cd30fea9c9c46aeb134e to your computer and use it in GitHub Desktop.
Restore day-only format for 2nd date in a date range in the same month
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 | |
add_filter( 'tribe_format_second_date_in_range', 'tribe_restore_no_month_format', 10, 2 ); | |
function tribe_restore_no_month_format( $format, $event ) { | |
if ( tribe_event_is_all_day( $event ) && tribe_get_end_date( $event, false, 'm' ) === tribe_get_start_date( $event, false, 'm' ) && tribe_get_end_date( $event, false, 'Y' ) === date( 'Y' ) ) { | |
$format = 'j'; | |
} | |
return $format; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment