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

WordPress Trac noreply at wordpress.org
Thu Dec 10 03:34:53 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:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"35850"]:
 {{{
 #!CommitTicketReference repository="" revision="35850"
 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.

 Props stephenharris.
 Fixes #34723.
 }}}

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


More information about the wp-trac mailing list