文章修订

最后更新于:2021-11-29 22:30:31

Post Revisions

结构

Th该结构定义了文章修订后数据中存在的所有字段。除非使用“_filter”查询参数构造字段,否则来自这些端点的任何响应都可以包含以下字段。

author

integer 
对象作者的ID。
Context: vieweditembed
date

string,
datetime (details)
对象发布的日期,基于站点时区。
Context: vieweditembed
date_gmt

string,
datetime (details)
对象发布的日期,以GMT为单位。
Context: viewedit
guid

object 
对象的全局唯一标识符。
只读
Context: viewedit
id

integer 
对象的唯一标识符。
Context: vieweditembed
modified

string,
datetime (details)
上次修改对象的日期,基于站点时区。
Context: viewedit
modified_gmt

string,
datetime (details)
上次修改对象的日期,以GMT为单位。
Context: viewedit
parent

integer 
父对象的ID。
Context: vieweditembed
slug

string 
对象的字母数字标识符,其类型是唯一的。
Context: vieweditembed
title

object 
对象的标题。
Context: vieweditembed
content

object 
对象的内容。
Context: viewedit
excerpt

object 
该对象的摘录。
Context: vieweditembed

文章修订集合

查询此端点以检索文章修订的集合。您可以使用下面的URL查询参数来控制和过滤您收到的响应。

定义

GET /gc/v2/posts/<parent>/revisions

请求示例

$ curl https://example.com/gc-json/gc/v2/posts/<parent>/revisions

参数

parent父对象的ID。
context提交请求的数据结构;明确响应字段结构。
默认: view
唯一: viewembededit
page集合的分页页码
默认: 1
per_page返回结果集的最大条数。
search字符串匹配的结果集。
exclude确保结果集排除特定ID。
include将结果集限制为特定ID。
offset将结果集偏移特定数量的项。
order排序属性升序或降序。
默认: desc
唯一: ascdesc
orderby按对象属性对集合排序。
默认: date
唯一: dateidincluderelevancesluginclude_slugstitle

检索文章单个修订

定义 & 请求示例

GET /gc/v2/posts/<parent>/revisions/<id>

Query this endpoint to retrieve a specific post revision record.

$ curl https://example.com/gc-json/gc/v2/posts/<parent>/revisions/<id>

参数

parent父对象的ID。
id对象的唯一标识符。
context提交请求的数据结构;明确响应字段结构。
默认: view
唯一: viewembededit

删除文章修订

参数

parent父对象的ID。
id对象的唯一标识符。
forceRequired to be true, as revisions do not support trashing.

定义

DELETE /gc/v2/posts/<parent>/revisions/<id>

请求示例

$ curl -X DELETE https://example.com/gc-json/gc/v2/posts/<parent>/revisions/<id>

检索单个文章修订

定义 & 请求示例

GET /gc/v2/posts/<id>/autosaves

查询此端点以检索特定的修订数据。

$ curl https://example.com/gc-json/gc/v2/posts/<id>/autosaves

参数

parent父对象的ID。
context提交请求的数据结构;明确响应字段结构。
默认: view
唯一: viewembededit

创建文章修订

参数

parent父对象的ID。
date对象发布的日期,基于站点时区。
date_gmt对象发布的日期,以GMT为单位。
slug对象的字母数字标识符,其类型是唯一的。
status对象的命名状态。
唯一: publishfuturedraftpendingprivate
password用于保护对内容和摘录的访问的密码。
title对象的标题。
content对象的内容。
author对象作者的ID。
excerpt该对象的摘录。
featured_media对象的特色图片的ID。
comment_status对象的是否开启评论。
唯一: openclosed
ping_status对象是否允许评论pingback。
唯一: openclosed
formatThe format for the object.
唯一: standardasidechatgallerylinkimagequotestatusvideoaudio
meta元字段。
stickyWhether or not the object should be treated as sticky.
template用于显示对象的主题文件。
categories在分类类型中指定给对象的分类项。
tags在分类类型中指定给对象的文章标签。

定义

POST /gc/v2/posts/<id>/autosaves

检索文章修订

定义 & 请求示例

GET /gc/v2/posts/<parent>/autosaves/<id>

查询此端点以检索特定的修订后数据。

$ curl https://example.com/gc-json/gc/v2/posts/<parent>/autosaves/<id>

参数

parent父对象的ID。
id对象的ID。
context提交请求的数据结构;明确响应字段结构。
默认: view
唯一: viewembededit