protected function insertNewPost( $post_type, $p, $html, $chapter_parent, $post_status ) {

		$new_post = [
			'post_title' => wp_strip_all_tags( $p['post_title'] ),
			'post_name' => $p['post_name'],
			'post_type' => $post_type,
			'post_status' => ( 'part' === $post_type ) ? 'publish' : $post_status,
			'post_content' => $html,
		];

		if ( 'chapter' === $post_type ) {
			$new_post['post_parent'] = $chapter_parent;
		}

		$pid = wp_insert_post( add_magic_quotes( $new_post ) );

		return $pid;
	}