WP_REST_Terms_Controller::check_is_taxonomy_allowed
Checks that the taxonomy is valid.
Method of the class: WP_REST_Terms_Controller{}
No Hooks.
Returns
true|false. Whether the taxonomy is allowed for REST management.
Usage
// protected - for code of main (parent) or child class $result = $this->check_is_taxonomy_allowed( $taxonomy );
- $taxonomy(string) (required)
- Taxonomy to check.
Changelog
| Since 4.7.0 | Introduced. |
WP_REST_Terms_Controller::check_is_taxonomy_allowed() WP REST Terms Controller::check is taxonomy allowed code WP 7.0
protected function check_is_taxonomy_allowed( $taxonomy ) {
$taxonomy_obj = get_taxonomy( $taxonomy );
if ( $taxonomy_obj && ! empty( $taxonomy_obj->show_in_rest ) ) {
return true;
}
return false;
}