Last active
December 25, 2018 23:07
-
-
Save cliffordp/9109ea4f072be52c3b923c224ab7eb2f to your computer and use it in GitHub Desktop.
MT - TEC - Custom Events Archive <title> (browser tab text)
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 | |
/** | |
* MT - TEC - Custom Events Archive <title> (browser tab text) | |
* | |
* from https://gist.github.com/cliffordp/9109ea4f072be52c3b923c224ab7eb2f | |
* for https://theeventscalendar.com/support/forums/topic/how-to-rename-the-of-the-events-list/#post-1273004 | |
* | |
* @return string | |
*/ | |
function tribe_events_archive_custom_title( $title ) { | |
$my_custom_title = 'My Custom Events Archive Title'; // change this!!! | |
if ( ! class_exists( 'Tribe__Events__Main' ) ) { | |
return $title; | |
} | |
$is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; | |
$is_truly_admin = is_admin() && ! $is_ajax; | |
if ( is_post_type_archive( Tribe__Events__Main::POSTTYPE ) && ! is_single() && ! $is_truly_admin && is_main_query() ) { | |
$title = esc_html( $my_custom_title ); | |
} | |
return $title; | |
} | |
add_filter( 'tribe_events_title_tag', 'tribe_events_archive_custom_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment