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

WordPress Trac noreply at wordpress.org
Thu Jan 7 03:23:25 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 boonebgorges):

 @DvanKooten Thanks for the patch. As it stands, it won't quite work - an
 empty array is a valid cache entry, and shouldn't count as a miss. It's
 standard practice throughout WP to do a strict `false ===` comparison when
 checking for cached values, for this and similar reasons.

 That said, it's possible that we could make the logic here more future-
 forward :) If you want to propose another approach, can you please open a
 different ticket that references this one (which is against a closed
 milestone)?

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


More information about the wp-trac mailing list