[wp-trac] [WordPress Trac] #11003: wp_get_object_terms Returns Duplicate Terms
WordPress Trac
noreply at wordpress.org
Tue May 27 03:28:07 UTC 2014
#11003: wp_get_object_terms Returns Duplicate Terms
--------------------------+---------------------
Reporter: filosofo | Owner: ryan
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.0
Component: Taxonomy | Version: 2.9
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses:
--------------------------+---------------------
Changes (by wonderboymusic):
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"28583"]:
{{{
#!CommitTicketReference repository="" revision="28583"
In `wp_get_object_terms()`, before returning terms (and before running
them through the 'wp_get_object_terms' filter) - run them through `$terms
= array_values( array_unique( $terms, SORT_REGULAR ) )`.
There will be "dupes" when the function is called with `'fields' =>
'all_with_object_id'`, but the objects will actually be unique due to the
`object_id` addition, so they shouldn't be filtered out.
Adds unit tests. All other unit tests pass.
Fixes #11003.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/11003#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list