[wp-trac] [WordPress Trac] #18106: get_terms of posts in a specific post_type

WordPress Trac noreply at wordpress.org
Wed Jul 8 11:47:32 UTC 2015


#18106: get_terms of posts in a specific post_type
-------------------------------+----------------------
 Reporter:  braydonf           |       Owner:
     Type:  feature request    |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Taxonomy           |     Version:
 Severity:  normal             |  Resolution:  wontfix
 Keywords:  close needs-patch  |     Focuses:
-------------------------------+----------------------

Comment (by boonebgorges):

 Replying to [comment:9 atomicjack]:
 > Why not make a change so that tags are a property of the posts
 @boonebgorges?

 Tags *are* a property of posts. That's why it's problematic to add a
 'post_type' argument to `get_terms()`, a function that is designed to get
 information about terms, not posts. Fetching terms based on object
 relationships means two additional table joins, which will scale poorly on
 many installations. So there are both performance problems and conceptual
 problems (scope creep of `get_terms()`).

 Pending a rearchitecture, if you need the terms belonging to a set of
 posts, use `wp_get_object_terms()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18106#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list