[wp-trac] [WordPress Trac] #45163: get_term_by() should accept ID as a field

WordPress Trac noreply at wordpress.org
Sat May 30 10:05:30 UTC 2020


#45163: get_term_by() should accept ID as a field
-------------------------------------------------+-------------------------
 Reporter:  emrikol                              |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.5
Component:  Taxonomy                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests revert      |     Focuses:
  2nd-opinion                                    |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch has-unit-tests revert => has-patch has-unit-tests
     revert 2nd-opinion


Comment:

 Indeed, `id` is already an alias for `term_id` here, and `ID` is now a
 third alias. While that seems a bit redundant, it adds  some consistency
 between the APIs despite the underlying database structure differences. I
 can see it both ways and don't necessarily object to the change. Would
 appreciate more opinions here.

 The documentation, however, needs some adjustment for consistency with
 that of `get_user_by()`.

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


More information about the wp-trac mailing list