[wp-trac] [WordPress Trac] #22394: is_object_in_term always returning false

WordPress Trac noreply at wordpress.org
Fri Nov 9 00:12:10 UTC 2012


#22394: is_object_in_term always returning false
-----------------------------+--------------------------
 Reporter:  picklewagon      |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  trunk            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+--------------------------
 Doing a lookup using is_object_in_term is always returning false. If the
 object terms it will return the terms correctly. The check to see if the
 cache lookup was successful always fails. The wrong object is being used
 to verify the cache lookup.

 Here is the current code:
 {{{
 $object_terms = get_object_term_cache( $object_id, $taxonomy );
 if ( false === $terms )
        $object_terms = wp_get_object_terms( $object_id, $taxonomy );
 }}}

 $terms is a parameter passed to the function. The code should be changed
 to:
 {{{
 $object_terms = get_object_term_cache( $object_id, $taxonomy );
 if ( false === $object_terms )
        $object_terms = wp_get_object_terms( $object_id, $taxonomy );
 }}}

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


More information about the wp-trac mailing list