[wp-trac] [WordPress Trac] #11003: wp_get_object_terms Returns Duplicate Terms
WordPress Trac
noreply at wordpress.org
Tue May 27 03:22:29 UTC 2014
#11003: wp_get_object_terms Returns Duplicate Terms
--------------------------+-------------------
Reporter: filosofo | Owner: ryan
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.0
Component: Taxonomy | Version: 2.9
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+-------------------
Changes (by wonderboymusic):
* keywords: has-patch dev-feedback => has-patch
* milestone: Future Release => 4.0
Comment:
Since we are trying to filter by uniqueness, the dupes that have different
values for `object_id` are not really dupes, and they only appear when `
'all_with_object_id'` is passed.
`$terms = array_values( array_unique( $terms, SORT_REGULAR ) );` pre-
filter works for both solutions described above.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/11003#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list