Un motore di ricerca WordPress per sviluppatori e autori di temi



is_object_in_taxonomy ›

Da3.0.0
Deprecaton/a
is_object_in_taxonomy ( $object_type, $taxonomy )
Parametri: (2)
  • (string) $object_type Object type string.
    Richiesto:
  • (string) $taxonomy Single taxonomy name.
    Richiesto:
Ritorna:
  • (bool) True if object is associated with the taxonomy, otherwise false.
Definito a:
Codex:

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



Sorgenti

function is_object_in_taxonomy( $object_type, $taxonomy ) {
	$taxonomies = get_object_taxonomies( $object_type );
	if ( empty( $taxonomies ) ) {
		return false;
	}
	return in_array( $taxonomy, $taxonomies );
}