is_object_in_taxonomy() WP 1.0
Determine if the given object type is associated with the given taxonomy.
Works based on:
get_object_taxonomies()
✈ 1 time = 0.000029s = very fast | 50000 times = 0.24s = very fast | PHP 7.1.1, WP 4.7.2
No Hooks.
Return
true/false. True if object is associated with the taxonomy, otherwise false.
Usage
is_object_in_taxonomy( $object_type, $taxonomy );
- $object_type(string) (required)
- Object type string.
- $taxonomy(string) (required)
- Single taxonomy name.
Code of is object in taxonomy:
wp-includes/taxonomy.php
VER 5.0.3
Related Functions
From category: For posts
- get_object_taxonomies()
- get_objects_in_term()
- get_the_category()
- get_the_category_list()
- get_the_tag_list()
- get_the_tags()
- get_the_taxonomies()
- get_the_term_list()
- get_the_terms()