[wp-trac] [WordPress Trac] #36227: get_categories does not return a valid wp_error
WordPress Trac
noreply at wordpress.org
Mon Mar 14 13:52:16 UTC 2016
#36227: get_categories does not return a valid wp_error
--------------------------+---------------------------
Reporter: virgodesign | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.5
Component: Taxonomy | Version:
Severity: normal | Resolution: fixed
Keywords: | Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"36988"]:
{{{
#!CommitTicketReference repository="" revision="36988"
Improve error handling in `get_categories()`.
When passed an invalid `'taxonomy'`, `get_terms()` will return a
`WP_Error`
object. This object should not be blindly cast to an array. Instead, an
empty
array should be returned, to indicate that no matching terms have been
found.
Props virgodesign, sebastian.pisula.
Fixes #36227.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36227#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list