[wp-trac] [WordPress Trac] #34723: Warning in get_the_terms() because of non-array
WordPress Trac
noreply at wordpress.org
Wed Jan 6 08:26:53 UTC 2016
#34723: Warning in get_the_terms() because of non-array
-----------------------------------+---------------------------
Reporter: mrppp | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.4.1
Component: Taxonomy | Version: 4.4
Severity: normal | Resolution: fixed
Keywords: fixed-major has-patch | Focuses:
-----------------------------------+---------------------------
Comment (by swissspidy):
Replying to [comment:18 DvanKooten]:
> Oops. I messed up that previous patch - how do I remove it?
>
> After looking at this a bit more, it seems to make sense to perform
stricter checking in the other places as well. We really only want to
update the cache & map each term if we got an array so the attached patch
should make more sense.
>
> The code can be a lot simpler if the `WP_Error` object doesn't need to
run through the `get_the_terms` filter. Any reason you want to do this
@swisspidy?
Me (with three s's btw)? Good question :-)
I assume this was done so plugins can hook into `get_the_terms` to return
their own terms from somewhere, even when it's a `WP_Error` object.
Removing this would break backwards compatibility.
Besides that, [attachment:34723.4.patch] makes sense to me.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34723#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list