Tribe__Validator__Base::is_term_of_taxonomy( mixed $term, string $taxonomy )

Whether the term exists and is a term of the specified taxonomy.


Parameters

$term

(mixed) (Required) Either a single term term_id or slug or an array of term_ids and slugs

$taxonomy

(string) (Required)


Top ↑

Return

(bool)


Top ↑

Source

File: src/Tribe/Validator/Base.php

	public function is_term_of_taxonomy( $term, $taxonomy ) {
		$terms = Tribe__Utils__Array::list_to_array( $term, ',' );

		if ( empty( $terms ) ) {
			return false;
		}

		foreach ( $terms as $t ) {
			if ( ! term_exists( $t, $taxonomy ) ) {
				return false;
			}
		}

		return true;
	}