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

WordPress Trac noreply at wordpress.org
Thu Dec 17 23:13:40 UTC 2015


#34723: Warning in get_the_terms() because of non-array
-----------------------------------+---------------------------
 Reporter:  mrppp                  |       Owner:  boonebgorges
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:  4.4.1
Component:  Taxonomy               |     Version:  4.4
 Severity:  normal                 |  Resolution:
 Keywords:  fixed-major has-patch  |     Focuses:
-----------------------------------+---------------------------
Changes (by joedolson):

 * keywords:  fixed-major => fixed-major has-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 `get_object_term_cache()` is used to set `$terms` before calling
 `wp_get_object_terms()`, and that function returns either an array or
 boolean `false`. If it returns false, it will return true for `!
 is_wp_error()` and throw a warning when a non-array is passed to
 `array_map`.

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


More information about the wp-trac mailing list