I am working in a WP Multisite environment. I have a custom post type set up with 1500 items in it. I am trying to set up a custom taxonomies with specific relationships. I've written a script that:
- inserts term_id, name, slug to wp_65_terms,
- inserts term_id, taxonomy, description and count to wp_65_term_taxonomy (term_id from wp_65_terms)
- inserts object_id, term_taxonomy_id and term_order to wp_65__term_taxonomy (object_id from wp_65_posts, and term_taxonomy_id from wp_65_terms)
(the site I'm working on has the site id of 65, thus the "wp_65_" above)
My script successfully creates new taxonomies, BUT the relationships to the custom post types is not displayed.
Is there another place in the database that controls the display of relationships to taxonomies?
Thank you for your help
(in the attached screenshot, you see the list of taxonomies, but none are selected -- contrary to what I would expect)
Dear jonathan,
This is a custom codes question, according to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/
Wordpress is using database table "wp_term_relationships" to setup the relationship between "posts" and "terms"
I suggest you use wordpress function wp_set_object_terms() to setup terms of each post, see wordpress document:
https://codex.wordpress.org/Function_Reference/wp_set_object_terms
Relates an object (post, link etc) to a term and taxonomy type (tag, category, etc).