WordPress - 使用版本 2 用 rest API 回复评论

WordPress - Reply on comments with rest API using version 2

如何使用版本 2 的 WordPress rest API 发送对评论的回复评论?

我对第 2 版的 WordPress rest API 进行了大量搜索,但没有找到合适的解决方案。

在 WordPress 中,"reply" 是带有父 ID 的评论。

您可以在评论请求中添加参数 "parent"。

如果评论是回复,您只需在请求中发送带有参数 "parent" 的评论。 parent 是评论回复的ID。

在文档中插入评论的example中,评论父级为0,因为它是主要评论。要插入回复 - 您将回复的评论 ID 添加为父 ID。 https://codex.wordpress.org/Function_Reference/wp_insert_comment