Uses
Uses | Description |
---|---|
wp-includes/taxonomy.php: get_object_taxonomies() | Return the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
Determine if the given object type is associated with the given taxonomy.
(string) (Required) Object type string.
(string) (Required) Single taxonomy name.
(bool) True if object is associated with the taxonomy, otherwise false.
File: wp-includes/taxonomy.php
function is_object_in_taxonomy( $object_type, $taxonomy ) { $taxonomies = get_object_taxonomies( $object_type ); if ( empty( $taxonomies ) ) { return false; } return in_array( $taxonomy, $taxonomies, true ); }
Version | Description |
---|---|
3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_object_in_taxonomy