Skip to content

Instantly share code, notes, and snippets.

@slimndap
Last active December 29, 2017 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimndap/f929599e8dc7311bc0e5bf74ad17f155 to your computer and use it in GitHub Desktop.
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.
<?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