I solved by force refreshing the cache (by @passatgt).
i.e., place this line after the insertion:
delete_option("{$taxonomy}_children");
Thanks!
Related Posts:
- Check is category parent with ids from the childs – get_term_children
- Get the children of the parent category
- Check if a post is in any child category of a parent category
- How to display non-hierarchical taxonomy as terms with checkboxes?
- How to make child categories recognize parent’s template displays
- Different template for subcategories
- Categories’ hierarchy in URL
- How to only show posts on last child category
- Show children of top level category only
- How can I make wp_list_categories output li with category-slug as class, for its children?
- Categories lose hierarchy order once assigned to post
- Add Product categories to WordPress menu without losing hierarchy
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- how to get the categories for a single post in a hierarchical way
- Category tree is flattened inside admin upon saving
- Show only first children level of current category?
- Categories vs. Page Site Organization
- How to enable category hierarchy for links?
- Query Posts Exclude Entire Category
- Combining post categories and link categories?
- How to categorize posts under Category 1 and Category 2 which are separate lists of categories, and display them as separate lists in widgets
- Category shows only top level child categories
- Give a page priority over a category that has the same name?
- Add child category to parent on post creation and save
- How do I make the category sidebar widget (stock) display the total # of posts including those in subcategories?
- How to get Next/previous_post_link to go through articles in top parent category
- Hierarchical permalink structure for posts showing categories and sub-categories
- Give Children Unique ID’s
- WordPress list categories dropdown with parent-child relation and child under it’s parent
- Display only subcategories of a category and not sub-subcategories
- List child categories from parent category on custom taxonomy page
- How to load several hierarchical categories from functions.php
- Posts not listing out sub category in hierarchy
- list all child categories that apply to current post even if those cats are empty?
- Check for parent category
- Show subChild categories
- Parent Category and Subcategory default text generated with category
- outputting taxonomy hierarchy
- How to create template for children category?
- Different template for subcategories
- Need list of child category post titles sorted by child category
- Most efficient use of custom taxonomies, categories, and pages
- list first post of Child Category on Category page
- Display categories and their IDs
- how to display page title only for child category pages
- How to retrieve posts from parent category, splitting them per children when displayed?
- List the category tree of all the product_cat categories
- Categories breadcrumb in a hierarchical order
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Is There a Difference Between Taxonomies and Categories?
- List all subcategories from category
- How To Find Out WordPress Category Table in MYSQL?
- Add custom field to Category
- Get Category ID inside Category template
- Only one category per post
- WordPress Multisite – global categories
- Get posts from sites in Multisite?
- WP REST API: filter by category 1 AND category 2
- How can I allow commas in tag names?
- How To Get Parent Category Slug of Current Post
- Display All Products by Category with WooCommerce
- What is the difference between a “tag” and a “category”?
- Is there an easy way to make a meta box have the tabs like the Categories meta box has?
- How to check if I’m on the last page of posts?
- Display posts from the same category using next/previous post link
- How would I get a taxonomy/category list inside a Gutenberg block?
- Can I set a default featured image for a category?
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Force category choice before creating new post?
- Gutenberg editor add a custom category as wrapper for custom blocks
- WooCommerce: List All Categories
- How to get category and archive title?
- Get category ID from category slug (not working)
- How do I remove “Uncategorized” from posts with more than 1 category?
- Get rid of WordPress category, tag and author archives?
- Individual rss feed entry length for categories?
- How can I create a category landing page followed by pages of posts?
- Remove parent category from permalink? Basically only have the child category?
- Custom permalink structure leads to be 404 on pagination
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Posts URL structure like site.com/category/the-post-title
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to get permalinks with category base working with sub-categories
- How to remove the term “category” from category pagination?
- Using wp_category_checklist in a widget
- WP 3.9 TinyMCE no longer loads on category description editor
- On the category page, get the category object
- Get only the top level categories using get_categories() without foreach loop
- Get all categories and posts in those categories
- How to add featured image for category (without a plugin)?
- How to create a custom sort for WordPress categories
- Category archive by year with permalink support /category/YYYY
- Best Way to Redirect Category to Page and Hide Category
- get_terms vs. get_categories: does it matter?
- What is a good robots.txt?
- Allow users to create their own feed from selected categories?
- Hook when category is added to post
- get_categories for custom post type with a specific custom taxonomy attached
- Add a URL prefix to permalinks of one category of posts only
- How do you add categories to custom post types in WordPress?