[wp-trac] [WordPress Trac] #16464: get_term_by() returns WP_Error as well

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 5 13:29:25 UTC 2011


#16464: get_term_by() returns WP_Error as well
--------------------------+-----------------------------
 Reporter:  hakre         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 It's not documented, but get_term_by() can return WP_Error as well in case
 it fails.

 Code that checks for the return value only against being not empty is
 doing short as WP_Error never is empty.

 The result are most often undefined property warnings.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16464>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list