I have a feeling this is going to be a conversation with myself, oh well, at least it’ll be documented…
I have found the following using the example of entering “Montgomery” into the “Alabama” category:
1. WP enters the location into the database – (insert into wp_terms (name, slug) values(‘Montgomery’, ‘montgomery’)
2. WP enters the new term into the taxonomy table – (insert into wp_term_taxonomy (term_id, taxonomy, description, parent, count) values (‘486’, ‘category’, ”, ‘184’, ‘1’)
3. I have created a default post that is assigned to each new entry. I’m only doing this so that I don’t get a 404 error page when a user clicks on a category without any posts. I also have to do this becuase even though I have “show empty categories” turned on, the empty categories are not shown. It looks like a category is considered empty if there are no posts in it, even if there are subcategories in it. At any rate, WP seems to be assigning the post to the category. When I go to the post, either in the admin view or visit the post as a subscriber, I see “Montgomery” listed as one of the categories it is posted to – (insert into wp_term_relationships (object_id, term_taxonomy_id) values (’42’, ‘481’)
4. After this, I go to a page that updates the WP-dTree Cache. More on this in number 6…
5. What I’m not seeing happen though, is the newly created category show up under its parent on the Manage -> Categories page. Even though the SQL statement is executed successfully, the category doesn’t actually show up until I associate another post with it. To do this I’m using TDO Mini-forms. Once I associate a post with this category, it shows up as a subcategory of Alabama, as it should.
6. Another interesting point is that once a category has a sub category, other sub-categories show up as expected. I only have a problem with the first sub-category I enter. So, for example, if I go through the whole thing and insert “Montgomery” as a subcategory of Alabama, using the TDO Mini-Forms method described above, the next time I insert a new category into Alabama, say, Tuscaloosa, Tuscaloosa will show up, right after I refresh the WP-dTree cache.
So, the problem is that on the first time I attempt to create a sub-category of a category, the newly created sub-category is not recognized as a sub-category until a post is associated with it, even though I have associated a post with it, and have correctly placed it into the taxonomy.
Am I missing a step in registering the new subcategory with the associated parent category?
Please? Anybody?