Forked from barryhughes/event-view-url-slug-filter.php
Created
April 28, 2017 13:14
-
-
Save cliffordp/8c1be9fe0569741cd50d25407b12cd37 to your computer and use it in GitHub Desktop.
Revision of custom event view slug snippet
This file contains 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
<?php | |
/** | |
* Modify the "bases" used to form event URLs for various views. | |
* | |
* @param array $bases | |
* | |
* @return array | |
*/ | |
function rename_event_view_slugs( $bases ) { | |
if ( isset( $bases['month'] ) ) $bases['month'] = [ 'calendar', 'calendar' ]; | |
if ( isset( $bases['list'] ) ) $bases['list'] = [ 'all-events', 'all-events' ]; | |
if ( isset( $bases['photo'] ) ) $bases['photo'] = [ 'picture-board', 'picture-board' ]; | |
return $bases; | |
} | |
/** | |
* Wire up our code used to modify event slugs in the rewrite rules. | |
*/ | |
add_filter( 'tribe_events_rewrite_base_slugs', 'rename_event_view_slugs', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment