Created
March 30, 2015 20:13
-
-
Save anonymous/6af2b065e82b33dbb133 to your computer and use it in GitHub Desktop.
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' ); | |
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