I’m not familiar with woocommerce, but in general, taxonomies are registered via the init hook with a priority of 1 or default priority which is 10
Your code is fine, so I suspect that your priority is wrong here. In short, you are trying to add the taxonomy to the post type before the taxonomy even exists. Try adding a priority of 11 or higher. This would ensure that the taxonomy is registered before you try to assign it to a specific post type
Related Posts:
- How to use taxonomies on attachments with the new Media Library?
- Add custom taxonomy fields when creating a new taxonomy
- How to display custom taxonomies in posts?
- Creating Custom Taxonomy without mapping to any post type
- Exclude specific slug in ‘get_terms’
- wp_insert_term – parent & child problem
- Widget to display custom taxonomy tag cloud
- Hook to process a new taxonomy tag before it is created?
- Return only the custom sub-term for custom post type, do not echo term-parent
- Get total number of comments from posts in a specific custom taxonomy
- Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
- wp_options table value
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Adding session variable and/or cookie based on user-selected input
- How to display term description in empty terms archive?
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Create Child Taxonomies
- Query Posts by taxonomy/Taxonomy Child Custom order
- How can I get WP to build a feed based on multiple taxonomy terms
- Change permalink of post if it belongs to custom taxonomy
- Current category link filter
- display taxonomy slug from term ID
- Make a taxonomy column sortable in the admin?
- Redirect all child taxonomy to its parent
- How to display custom taxonomy images on index.php?
- How do I taxonomy terms based on terms they are used alongside?
- get_term and get_term_by return null or false, even though term exists
- How can I populate a select element with terms from a custom taxonomy and filter post results?
- How do I list the pages of a custom taxonomy?
- Get number of post who belongs in two taxonomies!
- Why does a new taxonomy term get created when I assign an existing term to a post?
- Add Image Uploader In Admin Panel
- Tell the difference between a term and page when they have the same ID
- WordPress thinks my custom taxonomy pages are search pages #seo
- How to use multiple archive templates for a taxonomy?
- Adding custom taxonomy in my existing category URL
- Create custom taxonomy and Display in metabox dropdown
- Custom Taxonomy with tax_query
- Get posts in certain Taxonomy terms for the current page url
- How to add images to taxonomy terms? [duplicate]
- Why get_page_template() doesn’t show taxonomy template file name?
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Edit custom taxonomy description programatically
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- How to get attached image to taxonomy..?
- How to get list of only custom taxonomies?
- Add custom taxonomy as a css class
- Taxonomy archive template that shows posts from more than one taxonomy
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- Unable to get the Parent Custom Taxonomy Terms
- How to get the term description in a taxonomy term archive query?
- How to define %category% for custom taxonomies?
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- new custom filed not showing in taxonomy
- Fill New Taxonomies
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- Filter “get_terms” query
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Dropdown (with onChange) with custom taxonomies
- generate random slug when adding taxonomy
- ACF Custom field not showing in Timber Taxonomy page
- How to get a terms and posts associated with another term?
- Displaying subcategories and then posts in taxonomy template
- How to use two same taxonomy in same post differently?
- Sort Taxonomy List by Custom Values
- Display taxonomy term slugs
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- How to display custom taxonomy
- Taxonomy term breadcrumb; how?
- Advanced AND tax_query in sidebar with 2 taxonomies
- Using wp_query is it possible to orderby taxonomy?
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- Get custom taxonomy term url on archive page
- Custom Taxonomy Template Variables Available?
- Adding new terms to custom taxonomy
- Group custom taxonomies based on tags contained in their posts
- Make custom post type display with custom taxonomy in url
- is_tax not working for custom taxonomy
- Add custom display condition to Elementor Theme Builder for custom taxonomy children, grandchildren, and great-grandchildren
- Add text in custom taxonomy
- How do I check if a post has a term with a particular ancestor/parent?
- Issue with WordPress Automatically Assigning Terms to Multiple Posts