public function create_item_permissions_check( $request ) {

		if ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {
			return false;
		}

		$taxonomy_obj = get_taxonomy( $this->taxonomy );
		if ( ! current_user_can( $taxonomy_obj->cap->manage_terms ) ) {
			return new WP_Error( 'rest_cannot_create', __( 'Sorry, you cannot create new resource.' ), array( 'status' => rest_authorization_required_code() ) );
		}

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

		if ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {
			return false;
		}

		$taxonomy_obj = get_taxonomy( $this->taxonomy );
		if ( ! current_user_can( $taxonomy_obj->cap->manage_terms ) ) {
			return new WP_Error( 'rest_cannot_create', __( 'Sorry, you cannot create new resource.' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}
public function create_item_permissions_check ( $ request ) { if ( ! $ this -> check_is_taxonomy_allowed ( $ this -> taxonomy ) ) { return false ; } $ taxonomy_obj = get_taxonomy ( $ this -> taxonomy ) ; if ( ! current_user_can ( $ taxonomy_obj -> cap -> manage_terms ) ) { return new WP_Error ( 'rest_cannot_create' , __ ( 'Sorry, you cannot create new resource.' ) , array ( 'status' => rest_authorization_required_code ( ) ) ) ; } return true ; }
Checks if a request has access to create a term.

@param  WP_REST_Request $request Full details about the request.
@return WP_Error|boolean
Checks if a request has access to create a term .