[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 09:08:06 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):

 The only edge case I can see is the integer 0.
 From a quick search on Github it's quite common to pass an integer as
 value for "object_ids".
 In that case it would be a breaking change.
 Before 0 => array(0) => potentially no result
 After 0 => array() => no filter

 Moreover the doc says:
 "Object ID, or array of object IDs. Results will be limited to terms
 associated with these objects."
 So 0 should be a valid value and it should filter results for terms
 associated with the objects with the ID equals to 0.

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


More information about the wp-trac mailing list