Hey Ryan, the plugin is actually called ‘The Events Calendar’ – https://www.ads-software.com/extend/plugins/the-events-calendar/ (creative right?)
I think I’ve narrowed down the issue to the rewrite function that the plugin calls by using add_filter( ‘generate_rewrite_rules’ … (line 335 in the-events-calendar.class.php if you’re looking at the code).
The actual rewrite function is this:
public function filterRewriteRules( $wp_rewrite ) {
if( $useRewriteRules = eventsGetOptionValue('useRewriteRules','on') == 'off' ) {
return;
}
$categoryId = get_cat_id( The_Events_Calendar::CATEGORYNAME );
$eventCategory = get_category( $categoryId );
$eventCats = array( $eventCategory );
$childCats = get_categories("hide_empty=0&child_of=$categoryId");
$eventCats = array_merge( $eventCats, $childCats );
$newRules = array();
foreach( $eventCats as $cat ) {
$url = get_category_link( $cat->cat_ID );
$base = str_replace( trailingslashit( get_option( 'siteurl' ) ), '', $url );
$newRules[$base . 'month'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=month';
$newRules[$base . 'upcoming/page/(\d+)'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=upcoming&paged=' . $wp_rewrite->preg_index(1);
$newRules[$base . 'upcoming'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=upcoming';
$newRules[$base . 'past/page/(\d+)'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=past&paged=' . $wp_rewrite->preg_index(1);
$newRules[$base . 'past'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=past';
$newRules[$base . '(\d{4}-\d{2})$'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=month' .'&eventDate=' . $wp_rewrite->preg_index(1);
$newRules[$base . '?$'] = 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=' . eventsGetOptionValue('viewOption','month');
}
$wp_rewrite->rules = $newRules + $wp_rewrite->rules;
}
The only time this breaks is when permalinks have been set to include the category name in the URL (i.e. /%category%/%postname%).