Last active
December 29, 2017 10:23
-
-
Save slimndap/f929599e8dc7311bc0e5bf74ad17f155 to your computer and use it in GitHub Desktop.
Changes the header for today and tomorrow in lists that are grouped by day.
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
<?php | |
/** | |
* Changes the header for today and tomorrow in lists that are grouped by day. | |
* | |
* @param string $header The header. | |
* @param string $day The day. | |
* @param array $args The arguments for the HTML of this list. | |
*/ | |
function change_grouped_by_day_header( $header, $day, $args ) { | |
if ( date( 'Y-m' ) == $day ) { | |
$header = 'Today'; | |
} | |
if ( date( 'Y-m', strtotime( 'Tomorrow' ) ) == $day ) { | |
$header = 'Tomorrow'; | |
} | |
return $header; | |
} | |
add_filter( 'wpt_listing_group_day', 'change_grouped_by_day_header', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment