Forked from anonymous/filter-tec-month-list-url-links.php
Last active
August 29, 2015 14:22
-
-
Save theeventscalendar/617db40637a4b352174e to your computer and use it in GitHub Desktop.
Makes the calendar respect new slug names
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
/** | |
* @param string $url | |
* @param string $type | |
* @return string | |
*/ | |
function modify_month_list_link_urls( $url, $type ) { | |
if ( 'month' === $type ) return str_replace( 'month', 'calendar', $url ); | |
if ( 'list' === $type ) return str_replace( 'list', 'all-events', $url ); | |
if ( 'photo' === $type ) return str_replace( 'photo', 'picture-board', $url ); | |
return $url; | |
} | |
/** | |
* Change specific event view slugs when we link to them via the view selector | |
* and other places. | |
*/ | |
add_filter( 'tribe_events_getLink', 'modify_month_list_link_urls', 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment