[wp-trac] [WordPress Trac] #54065: Docs: clarify that `term_id` is a valid value of the `field` parameter of `get_term_by()`

WordPress Trac noreply at wordpress.org
Thu Sep 2 22:25:35 UTC 2021


#54065: Docs: clarify that `term_id` is a valid value of the `field` parameter of
`get_term_by()`
--------------------------+-----------------------------
 Reporter:  audrasjb      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:  docs          |
--------------------------+-----------------------------
 In the Parameters section, the text for the first parameter ($field) says:

 > Either 'slug', 'name', 'id' or 'ID' (term_id), or 'term_taxonomy_id'.

 The function accepts ‘term_id’ and it's the actual property name of the
 WP_Term object, so I guess it should appear first and we should make it
 more clear that `id` and `ID` are aliases.

 I’d propose to replace the current docs with something like:

 > Either 'slug', 'name', 'term_id' (or 'id', 'ID'), or 'term_taxonomy_id'.

 (thanks @gazchap for catching this in a DevHub user note)

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


More information about the wp-trac mailing list