[wp-trac] [WordPress Trac] #63256: Unnecessary array_map() call in get_terms() when object_ids is not set
WordPress Trac
noreply at wordpress.org
Mon Oct 27 15:30:45 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: lowest | Milestone: 6.9
Component: Taxonomy | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch needs-testing needs-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Changes (by westonruter):
* priority: normal => lowest
* version: => 4.7
Comment:
The `object_ids` arg was introduced in #37198, but it doesn't seem the
original code had the issue:
{{{#!php
<?php
if ( ! empty( $args['object_ids'] ) ) {
$object_ids = $args['object_ids'];
if ( ! is_array( $object_ids ) ) {
$object_ids = array( $object_ids );
}
$object_ids = implode( ', ', array_map( 'intval', $object_ids ) );
$this->sql_clauses['where']['object_ids'] = "tr.object_id IN
($object_ids)";
}
}}}
I any case, "issue" is a strong word because it's not like wastefully
calling `array_map()` with `intval` is going to have any noticeable
performance impact in any way.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63256#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list