[wp-trac] [WordPress Trac] #37368: get_object_taxonomies() ignores output type argument for attachments
WordPress Trac
noreply at wordpress.org
Tue Aug 30 03:01:48 UTC 2016
#37368: get_object_taxonomies() ignores output type argument for attachments
--------------------------------------+---------------------
Reporter: Rarst | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.7
Component: Taxonomy | Version: 3.0
Severity: normal | Resolution: fixed
Keywords: good-first-bug has-patch | Focuses:
--------------------------------------+---------------------
Comment (by boonebgorges):
Replying to [comment:12 swissspidy]:
> This breaks on HHVM because `array_unique()` does a string comparison
and cannot convert a `stdClass` object to a string.
>
> Could probably be solved by introducing `WP_Taxonomy` in #36224 with a
`__toString()` method.
Thanks, @swissspidy. `__toString()` would suppress the error. But in this
case, running `array_unique()` doesn't do anything when `output=objects`,
because `array_merge()` will cause duplicate indexes to overwrite each
other. So let's save the cycles when we're fetching objects.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37368#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list