[wp-trac] [WordPress Trac] #21606: term_exists returns 0 and null
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 16 19:50:32 UTC 2012
#21606: term_exists returns 0 and null
--------------------------+-------------------------
Reporter: barrykooij | Owner: barrykooij
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: Taxonomy | Version: 3.4.1
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-------------------------
Comment (by SergeyBiryukov):
> Because of the different type of return values it's not possible to do a
strict check on the return value to see if a term was found.
Consistency is good, but I wonder where the need for a strict check comes
from.
It should be possible to check with `if ( ! term_exists( 'events',
'post_tag' ) )` if a term was not found, unless I'm missing something.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21606#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list