after_setup_theme
fires before init
, so in this case the code is trying to insert a term into your taxonomy before WordPress is aware that your taxonomy exists!
Generally, I feel like init
is a better location for both pieces of functionality unless you have a reason to do otherwise. But however you resolve it, if you keep the two in separate functions and use the same action, you might want to give the hook which is used to insert terms a larger priority number just for peace of mind, such that it will most definitively always execute after the taxonomy is registered.
Related Posts:
- Using wp_query is it possible to orderby taxonomy?
- custom post type taxonomy “tag” archive : no post found
- Get taxonomy names by post id
- Modify Term Update Redirection
- 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
- Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children
- get_terms() doesn’t return empty terms even though hide_empty is false
- Formating the_terms() function output
- Archive template for taxonomy terms
- Custom taxonomy on users with UI
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Taxonomy Relationships
- Combine multiple custom user taxonomy in single url
- Add custom taxonomy to default category taxonomy?
- Display sub-taxonomies based on SELECTED parent-taxonomy
- 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?
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Get terms ordered by post date
- How to display custom taxonomy in multiple columns?
- How can I get WP to build a feed based on multiple taxonomy terms
- Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area
- Change permalink of post if it belongs to custom taxonomy
- Sorting taxonomy columns by meta value numeric
- Get pages only with a specific taxonomy
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- Share taxonomy between user and posts?
- How to filter terms from a custom taxonomy by a usermeta value on all screens and templates
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Get Current Custom Taxonomy ID by Post ID
- Use get_the_terms to list subcategories of custom taxonomy
- Get taxonomy parent using child slug (from merged taxonomies)
- I used the Tax-meta-class by bainternet but i still can’t get it to display any of the results.
- Custom taxonomy [year] is directing to yearly archive
- Display Taxonomy Terms in an option tag with value being the slug
- Modify “View” in admin panel for custom taxonomy
- Hide product categories and taxonomy terms in menu if empty
- Custom taxonomy forms for user profile
- Query posts by taxonomy with current term
- get the taxonomies terms associated with users
- Add Taxonomy Subcategory To Permalink
- Replace taxonomy permalinks
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- problem in taxonomy-{taxonomy}.php pagination
- Custom Taxonomy with tax_query
- Override Taxonomy Template
- 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?
- 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
- How to get attached image to taxonomy..?
- How to get list of only custom taxonomies?
- Add custom taxonomy as a css class
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Amend taxonomy to search in wordpress admin
- Unique taxonomy for post
- 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
- Fill New Taxonomies
- add pagination in wordpress page template
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- Custom dropdown list taxonomy not saved
- How to get all the terms from a custom hierarchical taxonomy via REST api?
- Filter “get_terms” query
- Get post meta value outside of the loop
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Unable to create a new taxonomy
- Change link of taxonomy when get_the_term_list( is used?
- generate random slug when adding taxonomy
- Custom taxonomy shows full articles
- Sort Taxonomy List by Custom Values
- Change order custom taxonomy
- How to display custom taxonomy
- Register custom taxonomy from a Advenced custom field option page
- Taxonomy term breadcrumb; how?
- Using wp_query is it possible to orderby taxonomy?
- List of taxonomy archive index page links
- Insert taxonomy term to different table
- wp_get_object_terms count on taxonomies within an category archive
- Group custom taxonomies based on tags contained in their posts
- Make custom post type display with custom taxonomy in url
- How do I create a term for every value of a post meta?
- Save selected terms in order of custom taxonomy in post
- Add text in custom taxonomy
- How do I check if a post has a term with a particular ancestor/parent?
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade