Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theeventscalendar/617db40637a4b352174e to your computer and use it in GitHub Desktop.
Save theeventscalendar/617db40637a4b352174e to your computer and use it in GitHub Desktop.
Makes the calendar respect new slug names
/**
* @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