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
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Gutenberg editor add a custom category as wrapper for custom blocks
- Category Archive, list subcategories of each post
- Disable pagination only for specific category
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Check if post belongs to any category
- How to add categories to products in woocommerce programatically? [closed]
- Remove Parent Category from Child Category URL
- Multisite – create a category in specific site
- Allow users to post to a certain category
- Convert the default sub-category dashes to bullets or any other characters
- Link Attachment Image to Category
- Modify WordPress SQL Query to pull from within a category
- How can i insert term in a specific language of Polylang?
- How to retrieve more posts from a custom post type that are in the same category as the current post
- Category name field strips HTML tags. How can I reverse this?
- Same base for category and post
- Get all media categories
- Custom taxonomy/category order
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- Add tag parameter to category.php
- Check IF category_description exists
- What Must to Display the “mysite.com/category” URL?
- List recent posts with link to first category
- How do I add a category to my post_type
- Link from navbar to categories
- WordPress showing wrong category name
- Add posts of a certain category to a page
- How can I filter posts by tag on the fly
- wp_nav_menu not appearing correctly on category page
- Post not found when filtered by category ID
- Custom menu with categories and tags
- How to Show or Hidden Categories on page in WordPress?
- category description not showing in my woocommerce
- Hide Some Categories in Post Editor
- Should I select only the last child product category?
- Media Library Categories
- Exclude category from WP_Query args not working
- WordPress pagination based on category
- Make related posts display first in search result
- Display sub categories of a parent product in products – woocommerce [closed]
- Custom category for posts via XMLRPC
- How to load jquery tag-it plugin into admin?
- Include Category Description in search result
- Show parent-child relationship for categories in the wordpress admin
- How to assign different categories to pages in wordpress?
- All post of child category not in top category
- How to add a tag above a category post that displays the category name in WordPress
- Woocommerce – Display product category of product in Orders page
- How to show video from wp option value?
- How to link ACF relationship field to the new Query block in Full Site Editing
- Order Categories by Character Count
- How to remove the category from the url only for a specific category of articles on wordpress