Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.