[wp-trac] [WordPress Trac] #34723: Warning in get_the_terms() because of non-array

WordPress Trac noreply at wordpress.org
Thu Dec 10 03:43:52 UTC 2015


#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   |     Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"35851"]:
 {{{
 #!CommitTicketReference repository="" revision="35851"
 Improve handling for `WP_Error` objects in `get_the_terms()`.

 `wp_get_object_terms()` can return a `WP_Error` object. As such, the
 `get_the_terms()` cache wrapper should handle them properly. To wit:

 * Don't try to map an error object to `get_term()`. Introduced in [35032].
 * Don't cache an error object as taxonomy relationships. Introduced in at
 least [16487], maybe earlier.

 Ports [35850] to the 4.4 branch.

 Props stephenharris.
 Fixes #34723.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34723#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list