wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



is_object_in_taxonomy › WordPress Function

Od3.0.0
Przestarzałyn/a
is_object_in_taxonomy ( $object_type, $taxonomy )
Parametry: (2)
  • (string) $object_type Object type string.
    Wymagane: Tak
  • (string) $taxonomy Single taxonomy name.
    Wymagane: Tak
Powrót:
  • (bool) True if object is associated with the taxonomy, otherwise false.
Zdefiniowane na:
Codex:

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



Źródło

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