Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
Forked from anonymous/view-change-tec-391.php
Last active February 22, 2016 23:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save theeventscalendar/800ce8f9fafae49f2182 to your computer and use it in GitHub Desktop.
Save theeventscalendar/800ce8f9fafae49f2182 to your computer and use it in GitHub Desktop.
Renames Calendar Views
// We want to adapt the names of views listed within the Tribe Events Bar
add_filter( 'tribe-events-bar-views', 'rename_tribe_views_in_selector', 100 );
function rename_tribe_views_in_selector( $views ) {
// This lists the original view names you wish to change along
// with the substitutes to wish to use in their place
$to_change = array(
'List' => 'All Events',
'Month' => 'Calendar',
'Photo' => 'Picture Board',
);
// Look through the list of active views and modify names accordingly
foreach ( $views as &$view )
if ( isset( $to_change[ $view['anchor'] ] ) )
$view['anchor'] = $to_change[ $view['anchor'] ];
// Return our revised list
return $views;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment