Skip to content

Instantly share code, notes, and snippets.

@slimndap
Last active December 29, 2017 10:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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