wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



is_object_in_taxonomy › WordPress Function

Depuis3.0.0
Dépréciéen/a
is_object_in_taxonomy ( $object_type, $taxonomy )
Paramètres: (2)
  • (string) $object_type Object type string.
    Requis: Oui
  • (string) $taxonomy Single taxonomy name.
    Requis: Oui
Retourne:
  • (bool) True if object is associated with the taxonomy, otherwise false.
Défini(e) dans:
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 );
}