• Greetings,

    I have an obscure problem in the admin area that may be a bug (and if I need to post this elsewhere, please let me know). I am migrating a site to WordPress, and am creating a number of hierarchical taxonomies programmatically using the wp_insert_term() function. An example:

    Parent 1
    —child 1
    —child 2
    Parent 2
    —child 3
    —child 4
    Parent 3
    —child 5
    —child 6

    I am importing these all at once via code on a hidden page. The tags are all being imported correctly, because they are showing up on the “Edit Post” page in their appropriate panel (properly hierarchical), they can be searched for in the tag admin list, and the admin lists the correct number of tags – in this example 9.

    HOWEVER, when I go to the admin tag list, this is the only thing that shows:

    Parent 1
    —child 1
    —child 2
    Parent 2
    Parent 3

    ..but the the admin lists 9 tags. Troubleshooting this, I discovered that if import the children tags separately and REFRESH THE TAG LIST between each import, then the list will show up correctly.

    I have tested this with the default categories as well as custom taxonomies (hierarchical). This leads me to believe that there is a bug in how WordPress refreshes the tag list – clearly it is not generating this list directly from the database, because those tags are there. This list must be being cached somewhere.

    Obscure problem, I know, but if anyone has any thoughts, I’d appreciate it. Thanks!

The topic ‘(Bug?) Tags list not refreshing after programmatically adding child tags’ is closed to new replies.