version 2.8.2 (not available in version drop-down yet)
I am attempting to use wp_sitecategories to store preset, site-level categories. I am trying to determine how the id numbers auto-generated by MySQL coordinate across these three tables. I have added categories and manually set id numbers, as well as reading what I could find in the docs/forums.
There is some overlapping across these tables. First, there is no wp_site_term_taxonomy table. So all the taxonomy, even for site-level categories, is stored in each blog, not at the site level.
Along with this, it appears that the site categories, because they are implemented by copying ids into the wp_X_terms and wp_X_term_taxonomy tables and auto-generating a new term_taxonomy_id, have issues with possible mismatched term_ids across site-level and blog-level tables.
Here is the scheme I am planning to use, unless someone here at the forms has a legit criticism or better idea. I'm new to WordPress and MU, so I'm very open to suggestions:
My scheme:
I will be reserving a block of approximately 10,000 id numbers for site-level categories. I will achieve this by creating these entries in these tables:
wp_sitecategories:
term_id = 9999
wp_X_term_taxonomy:
term_taxonomy_id = 9999
term_id = 9999
This way, when a user creates their first new, blog-level category, the term_id and term_taxonomy_id will be 10000, and will auto-increment from there.
I said "approximately" 10,000 reserved ids because Uncategorized and Blogroll are taken as id=1 and id=2, respectively. Plus my 9999 is used, and zero is apparently never used, so I'm left with 9,996 reserved site-level categories/tags, which should be plenty.
The only thing I haven't quite figured out yet is how the wp_X_term_taxonomy tables are created for new blogs. There is no site-level taxonomy table to copy from, only many blog-level taxonomy tables. If anyone has insight into this I would appreciate it.
What do you think of this approach of reserving ids? Is there a better approach? I have tested adding new categories after manually editing term_ids to 9999, and the auto-increment works as I described.
Thanks!