Skip to content

Instantly share code, notes, and snippets.

@alaasalama
Forked from skyshab/example.php
Last active October 9, 2019 09:44
Show Gist options
  • Save alaasalama/ac53f97f0ad0614086490d4d068495da to your computer and use it in GitHub Desktop.
Save alaasalama/ac53f97f0ad0614086490d4d068495da to your computer and use it in GitHub Desktop.
Customize the events month view title
<?php
add_filter('tribe_get_events_title', 'my_custom_events_title');
function my_custom_events_title( $title ) {
$events_label_plural = tribe_get_event_label_plural();
if ( tribe_is_month() ) {
$title = sprintf(
esc_html_x( '%1$s %2$s %3$s', 'month view', 'the-events-calendar' ),
$events_label_plural,
'for',
date_i18n( tribe_get_date_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) )
);
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment