[wp-trac] [WordPress Trac] #20536: Make $taxonomy an optional argument to &get_term()

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 24 19:35:08 UTC 2012


#20536: Make $taxonomy an optional argument to &get_term()
-------------------------+------------------------------
 Reporter:  TomAuger     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:
 Severity:  minor        |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by duck_):

 Replying to [ticket:20536 TomAuger]:
 > Either way, there's no ambiguity that needs $taxonomy in order to be
 resolved. In fact, just by knowing the term's ID, you can get at the
 $taxonomy through a join to wp_term_taxonomy because term_id is unique.
 Even two terms with the same name would have different IDs and a single
 term_ID will not be associated with multiple wp_term_taxonomy records
 (although the database table IS built as a M<-->M intersection table which
 such a relationship is possible, WordPress doesn't re-use term records
 that way.)

 Unfortunately I don't think that's correct. If you add a new category
 named "test" and a new tag named "test" you get:

 {{{
 +---------+---------------+---------------+
 | term_id | name          | slug          |
 +---------+---------------+---------------+
 |       3 | test          | test          |
 +---------+---------------+---------------+
 }}}

 {{{
 +------------------+---------+---------------+
 | term_taxonomy_id | term_id | taxonomy      |
 +------------------+---------+---------------+
 |                3 |       3 | category      |
 |                4 |       3 | post_tag      |
 +------------------+---------+---------------+
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20536#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list