protected function do_save( \WP_Post $post ) {

		if ( ! $post->ID ) {
			$id = wp_insert_post( wp_slash( $post->to_array() ), true );
		} else {
			$id = wp_update_post( $post, true );
		}

		if ( is_wp_error( $id ) ) {
			throw new \InvalidArgumentException( 'Error encountered while saving WP_Post: ' . $id->get_error_message() );
		}

		return get_post( $id );
	}