admin管理员组文章数量:1130349
In a multi-site environment, I have a special need to get post terms (on a custom taxonomy) without the expensive operation of "switching blogs".
I thought I might write my own query to get terms for a given post on a given blog.
I'm looking through the three tables:
wp_3_terms
wp_3_term_relationships
wp_3_term_taxonomy
Yet I cannot see where there is a connection to post_id in any of these.
So the question:
How do terms link with a given post in the database? If I can know that, I can do the rest.
In a multi-site environment, I have a special need to get post terms (on a custom taxonomy) without the expensive operation of "switching blogs".
I thought I might write my own query to get terms for a given post on a given blog.
I'm looking through the three tables:
wp_3_terms
wp_3_term_relationships
wp_3_term_taxonomy
Yet I cannot see where there is a connection to post_id in any of these.
So the question:
How do terms link with a given post in the database? If I can know that, I can do the rest.
Share Improve this question edited May 27, 2014 at 8:18 Pieter Goosen 55.5k23 gold badges117 silver badges211 bronze badges asked May 26, 2014 at 22:13 user1915665user1915665 5591 gold badge6 silver badges15 bronze badges1 Answer
Reset to default 4The posts are related to taxonomies (taxonomy/tag) in the wp_3_term_relationships table, where the object_id column is the post's id, and the term_taxonomy_id is the taxonomy/tag id.
Depending on what you want to accomplish, the solution might be to create the same taxonomies at each blog. This way the tax_query should work as normal.
In a multi-site environment, I have a special need to get post terms (on a custom taxonomy) without the expensive operation of "switching blogs".
I thought I might write my own query to get terms for a given post on a given blog.
I'm looking through the three tables:
wp_3_terms
wp_3_term_relationships
wp_3_term_taxonomy
Yet I cannot see where there is a connection to post_id in any of these.
So the question:
How do terms link with a given post in the database? If I can know that, I can do the rest.
In a multi-site environment, I have a special need to get post terms (on a custom taxonomy) without the expensive operation of "switching blogs".
I thought I might write my own query to get terms for a given post on a given blog.
I'm looking through the three tables:
wp_3_terms
wp_3_term_relationships
wp_3_term_taxonomy
Yet I cannot see where there is a connection to post_id in any of these.
So the question:
How do terms link with a given post in the database? If I can know that, I can do the rest.
Share Improve this question edited May 27, 2014 at 8:18 Pieter Goosen 55.5k23 gold badges117 silver badges211 bronze badges asked May 26, 2014 at 22:13 user1915665user1915665 5591 gold badge6 silver badges15 bronze badges1 Answer
Reset to default 4The posts are related to taxonomies (taxonomy/tag) in the wp_3_term_relationships table, where the object_id column is the post's id, and the term_taxonomy_id is the taxonomy/tag id.
Depending on what you want to accomplish, the solution might be to create the same taxonomies at each blog. This way the tax_query should work as normal.
本文标签: How are terms connected with posts in database
版权声明:本文标题:How are terms connected with posts in database? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749122507a2319239.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论