Definition:
function is_object_in_taxonomy($object_type, $taxonomy) {}
Determine if the given object type is associated with the given taxonomy.
Parameters
- string $object_type: Object type string
- string $taxonomy: Single taxonomy name
Return values
returns:True if object is associated with the taxonomy, otherwise false.
Source code
function is_object_in_taxonomy($object_type, $taxonomy) {
$taxonomies = get_object_taxonomies($object_type);
if ( empty($taxonomies) )
return false;
if ( in_array($taxonomy, $taxonomies) )
return true;
return false;
}
2149

February 12, 2011 


No comments yet... Be the first to leave a reply!