Opened 12 years ago
Closed 12 years ago
#22394 closed defect (bug) (fixed)
is_object_in_term always returning false
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
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 );
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
[22476]