Forked from theeventscalendar/Renaming calendar views.php
Created
February 22, 2016 23:11
-
-
Save lepittenger/d568dae52cbfec2b62a4 to your computer and use it in GitHub Desktop.
Renames Calendar Views
This file contains hidden or 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
// 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