[wp-hackers] Register_Taxonomy, when is it needed?

Haluk Karamete halukkaramete at gmail.com
Mon Apr 9 16:31:53 UTC 2012


Another  WordPress-guts question..

Say, I am putting the records into the "wp_terms" and into the
"wp_term_taxonomy" tables *programmatically*.

example

I add a term in the "wp_terms" table called "audience" - (which turns out
to be with as termID = 100 )
and then I add 2 more terms into the same table ( wp_terms ) and these
terms are called "women" and "youth".  And as a result, I get termIDs 101
and 102, respectively.

then I goto the "wp_term_taxonomy" table, and add 2 records into it so that
I end up assigning the terms "youth" and "women" with the intent of they
are terms under the taxonomy called "audience".

But first I have to add this record
term_taxonomy_id____term_id____taxonomy
100_______________100_______audience

My understanding is that the above entry means that there is a term with
the id "100" ( which maps to the label "audience" ) and its associated with
the "audience" taxonomy. I hope this understanding is correct.

To add the two records that would associate the "women" and "youth" terms
under the taxonomy "audience", I do this;

term_taxonomy_id____term_id____taxonomy
101_______________101_______audience
102_______________102_______audience



More information about the wp-hackers mailing list