[wp-trac] [WordPress Trac] #12526: Introduce has_term() to the tax API

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 1 22:50:11 UTC 2010


#12526: Introduce has_term() to the tax API
-------------------------------------+--------------------------------------
 Reporter:  ptahdunbar               |        Owner:          
     Type:  enhancement              |       Status:  reopened
 Priority:  normal                   |    Milestone:  3.1     
Component:  Taxonomy                 |      Version:  3.0     
 Severity:  normal                   |   Resolution:          
 Keywords:  has-patch needs-refresh  |  
-------------------------------------+--------------------------------------

Comment(by scribu):

 > All the functions that make use of has_term not even have the taxonomy
 name in their function name.

 They're not relevant to the discussion precisely because they don't have a
 $taxonomy parameter.

 > Oh that's not true. For example is_object_in_term() has $taxnomy first
 and then $term.

 Ok, so you found a single counter-example. That doesn't validate adding
 yet another inconsistency.

 > Made a patch that puts the arguments into the expected order and removes
 their optional status (at least for the first two) as it makes no sense to
 run a check on a NULL taxononmy or look for the NULL term.

 NULL taxonomy no, but NULL term yes: check if the post has ''any'' terms
 in the given taxonomy.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12526#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list