[wp-trac] [WordPress Trac] #30620: get_term_by( 'term_taxonomy_id' ) should require $taxonomy param

WordPress Trac noreply at wordpress.org
Sun Dec 7 01:45:13 UTC 2014


#30620: get_term_by( 'term_taxonomy_id' ) should require $taxonomy param
-------------------------+-----------------------------
 Reporter:  joehoyle     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Taxonomy     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 As we all despise term_ids as it requires a id / taxonomy name pair, it's
 often nicer to use term_taxonomy_id as it's a much better identifier. This
 *should* mean it's not necessary to know the taxonomy of a given tt_id
 (just like one doesn't need to know the post_type of a post to get a post
 from ID). However, the $taxonomy param to get_term_by() is required.

 It seems to be it would be good to change $taxonomy to be not required in
 the cases of getting by tt_id with get_term_by().

 I'll write the code if anyone agrees this makes sense :)

 Apologies if that has ben addresses, I'm a bit out of the loop recently.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30620>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list