public function get_item_permissions_check( $request ) {

		$tax_obj = get_taxonomy( $request['taxonomy'] );

		if ( $tax_obj ) {
			if ( empty( $tax_obj->show_in_rest ) ) {
				return false;
			}
			if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) {
				return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}
public function get_item_permissions_check( $request ) {

		$tax_obj = get_taxonomy( $request['taxonomy'] );

		if ( $tax_obj ) {
			if ( empty( $tax_obj->show_in_rest ) ) {
				return false;
			}
			if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) {
				return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}
public function get_item_permissions_check ( $ request ) { $ tax_obj = get_taxonomy ( $ request [ 'taxonomy' ] ) ; if ( $ tax_obj ) { if ( empty ( $ tax_obj -> show_in_rest ) ) { return false ; } if ( 'edit' === $ request [ 'context' ] && ! current_user_can ( $ tax_obj -> cap -> manage_terms ) ) { return new WP_Error ( 'rest_forbidden_context' , __ ( 'Sorry, you are not allowed to manage this resource.' ) , array ( 'status' => rest_authorization_required_code ( ) ) ) ; } } return true ; }
Check if a given request has access a taxonomy

@param  WP_REST_Request $request Full details about the request.
@return WP_Error|boolean
Check if a given request has access a taxonomy