wpseek.com
A WordPress-centric search engine for devs and theme authors



is_object_in_taxonomy › WordPress Function

Since3.0.0
Deprecatedn/a
is_object_in_taxonomy ( $object_type, $taxonomy )
Parameters: (2)
  • (string) $object_type Object type string.
    Required: Yes
  • (string) $taxonomy Single taxonomy name.
    Required: Yes
Returns:
  • (bool) True if object is associated with the taxonomy, otherwise false.
Defined at:
Codex:

Determines if the given object type is associated with the given taxonomy.



Source

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 );
}