Tribe__Validator__Base::is_term_of_taxonomy( mixed $term, string $taxonomy )
Whether the term exists and is a term of the specified taxonomy.
Contents
Parameters
- $term
-
(mixed) (Required) Either a single term
term_idorslugor an array ofterm_ids andslugs - $taxonomy
-
(string) (Required)
Return
(bool)
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;
}