There was nothing wrong with my code above. I found the answer at the bottom of the Taxonomies page in the Codex:
If your site uses custom permalinks, you will need to flush your
permalink structure after making changes to your taxonomies, or else
you may see a “Page Not Found” error. Your permalink structure is
automatically flushed when you visit Settings > Permalinks in your
WordPress dashboard.
In my plugin I already had flush_rewrite_rules(); being called upon deactivation, and I had deactivated and reactivated it several times. The fact that this didn’t work really threw me for a loop.
But as soon as I visited Setting > Permalinks it all worked correctly!
Related Posts:
- Custom post types, taxonomies, and permalinks
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- How do I append multiple taxonomies to the URL?
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom Post type & Taxonomy URL structure
- Remove slug in taxonomy url
- Combining Multiple Taxonomies in one URL
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- custom post type and custom taxonomy permalink
- Why does a custom post type need the ”hierarchical’ args setting?
- Is there a way to use regular categories with custom post types?
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Help with a TV series Rewrite structure
- Permalink rewrite with custom post type and custom taxonomy
- Custom Post Type with Nested Taxonomy and Template Files
- Custom permalinks – post type – hierarchical taxonomy’s
- Semantic URL Custom Post Type and Taxonomies permalinks
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Permalink Structure problem with cpt and custom taxonomy
- Page to display an archive of taxonomies
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Custom post type permalinks giving 404s
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- How to show custom taxonomy in the permalink?
- Add the .html extension to custom post types
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Custom Permalink for Taxonimie and Custom Post Type
- Custom Taxonomy breaking pages permalinks
- Permalinks for custom post-types within custom taxonomies not found
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post types and permalinks
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Use different taxonomies in different custom post types’ permalinks?
- custom permalinks based on taxonomies for custom post type
- Custom template won’t load for a custom post type (custom permalinks used)
- Custom taxonomy in URL showing 404
- How to hook custom taxonomies to custom post types and make the permalinks work?
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- custom-taxonomy/post_name instead of the default post_type/post_name
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Can’t remove front from permalinks for custom taxonomy category page
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Permalinks: custom post type -> custom taxonomy -> post
- How to change permalink to include custom post type
- Custom post type, permalinks, taxonomies and blog posts
- Custom post type permalink tag 404
- set permalink for CPT
- Custom permalink with child taxonomy terms
- Custom post type Permalinks with hierarchical Taxonomies
- How to solve this custom post type goes to 404 page?
- Can’t use pagination with custom taxonomy
- Permalink problems with custom post type and custom taxonomy
- How to get all posts related to particular category name on button click?
- WordPress custom permalink and archive link for custom post type
- Enabling permalinks disables custom page template
- Custom post type category permalinks and archive pages
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Set priority to permalinks
- Changing CPT permalink
- Custom Taxonomy Archive generates 404
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- Remove CPT Slug with 2 taxonomies and 1 post meta
- Custom post type and taxonomy same slug
- How to structure a website with custom post types and custom taxonomies?
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Post Custom & Taxonomy 404 error
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- Custom taxonomy in custom post type archive with pagination
- Same permalink structure for all post types?
- Custom Post type and Taxonomy in post URL error
- How to retrieve the permalink for a specific (custom) term?
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Permalink Trouble with Custom Post Type
- WordPress Custom Permalink Structure with Custom Post Type and Taxonomies
- Category / Custom Post Type permalink issue
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Permalinks Works for Custompost type but not with pages Why?
- Problem with Custom Post Types, Taxonomy, permalink, Archive
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Have Custom Taxonomy Slug Fall Under Custom Post Type Slug
- Custom Post Types Do Not work on this permalink setting https://somedominaname.com/%category%/%postname%/
- How to get the proper category in permalink with custom post type assigned to multiple categories
- How does WordPress manage to differentiate between post and page URLs without a distinct base, and how can I replicate this functionality?