[wp-trac] [WordPress Trac] #37291: Check for WP_Error before echo in the_tags()

WordPress Trac noreply at wordpress.org
Tue Oct 11 01:40:16 UTC 2016


#37291: Check for WP_Error before echo in the_tags()
-------------------------------------+--------------------
 Reporter:  michalzuber              |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.6.2
Component:  Taxonomy                 |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+--------------------
Changes (by boonebgorges):

 * keywords:  has-patch needs-refresh => has-patch needs-testing
 * milestone:  Future Release => 4.6.2


Comment:

 @dd32 Yes, your idea is a good one. See [attachment:37291.2.diff]: if any
 call to `get_term()` returns an error object, `get_object_term_cache()`
 will bail, returning the `WP_Error`. `get_the_terms()` and friends are
 already built in such a way that the error object will be passed up the
 chain. Can you read the patch (especially the test, which tries to emulate
 a situation where `get_term()` would return an error) to make sure it
 captures the spirit of your idea?

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


More information about the wp-trac mailing list