WP_REST_Terms_Controller::check_is_taxonomy_allowed

Advertisement

Summery Summery

Checks that the taxonomy is valid.

Syntax Syntax

WP_REST_Terms_Controller::check_is_taxonomy_allowed( string $taxonomy )

Parameters Parameters

$taxonomy

(Required) Taxonomy to check.

Return Return

(bool) Whether the taxonomy is allowed for REST management.

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply