Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/6af2b065e82b33dbb133 to your computer and use it in GitHub Desktop.
Save anonymous/6af2b065e82b33dbb133 to your computer and use it in GitHub Desktop.
// 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' );
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',
);
// 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