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

WordPress Trac noreply at wordpress.org
Thu Oct 23 11:19:57 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 usmanshb):

 @staurand

 Good point. You’re right that 0 is the only edge case here. Since it’s
 valid to pass an integer as object_ids, changing the handling from
 array(0) to array() would indeed be a breaking change.

 As the documentation states, “Object ID, or array of object IDs. Results
 will be limited to terms associated with these objects,” the value 0
 should still be treated as a valid object ID. It should continue filtering
 for terms linked to object ID 0, rather than being ignored.

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


More information about the wp-trac mailing list