Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lepittenger/d568dae52cbfec2b62a4 to your computer and use it in GitHub Desktop.
Save lepittenger/d568dae52cbfec2b62a4 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