[wp-trac] [WordPress Trac] #63256: Unnecessary array_map() call in get_terms() when object_ids is not set

WordPress Trac noreply at wordpress.org
Sun Oct 26 16:07:03 UTC 2025


#63256: Unnecessary array_map() call in get_terms() when object_ids is not set
-------------------------------------+------------------------
 Reporter:  dilipbheda               |       Owner:  audrasjb
     Type:  defect (bug)             |      Status:  reviewing
 Priority:  normal                   |   Milestone:  6.9
Component:  Taxonomy                 |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------

Comment (by staurand):

 @westonruter
 The ticket is about the "object_ids" param, so I don‘t think it's related
 to term ID.

 It’s in practice related to post ids or other kind of "object IDs".
 But as the doc states, ''"Object ID, or array of object IDs. Results will
 be limited to terms associated with these objects."'', we can’t presume
 the kind of object it will be.

 So 0 should be a valid value and, as you stated, if the object is using an
 auto-incremented integer that will start at 1, this function should return
 no result (no object id will match 0, so no object with the id 0 is linked
 to a term).

 With the proposed patch it will return all terms (no filter).

 I hope the logic above makes sense :)

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


More information about the wp-trac mailing list