protected function determinePostType( $id ) {

		$chapters = getset( '_POST', 'chapters' );
		$supported_types = apply_filters( 'pb_import_custom_post_types', [ 'front-matter', 'chapter', 'part', 'back-matter', 'metadata', 'glossary' ] );
		$default = 'chapter';

		if ( ! is_array( $chapters ) ) {
			return $default;
		}

		if ( ! isset( $chapters[ $id ] ) && ! isset( $chapters[ $id ]['type'] ) ) {
			return $default;
		}

		if ( ! in_array( $chapters[ $id ]['type'], $supported_types, true ) ) {
			return $default;
		}

		return $chapters[ $id ]['type'];
	}