页面
页面属性
页面属性 data
ID
页面id
是
[int]
post_date
创建时间(local)
是
[datetime]
post_date_gmt
创建时间(GMT)
是
[datetime]
post_modified
更新时间(local)
是
[datetime]
post_modified_gmt
更新时间(GMT)
是
[datetime]
title
页面标题
是
[string]
content
页面内容
是
[string]
status
页面状态
是
[string]
slug
页面slug
是
[string]
seo_title
页面SEO标题
是
[string]
seo_description
页面SEO描述
是
[string]
public_url
标题链接
是
[string]
base_url
主链接
是
[string]
path
路径
是
[string]
update_date_gmt
更新时间GMT
是
[datetime]
template
模板类型
是
[string]
列表参数 links
first
第一页
是
[string]
last
最后一页
是
[string]
prev
上一页
是
[string]
next
下一页
是
[string]
列表参数 meta
current_page
当前页码
是
[int]
from
当前页起始条数号
是
[number]]
last_page
尾页页码
是
[number]
path
分页基本url
是
[string]
per_page
每页显示条数
是
[number]
to
当前页结束条数号
是
[number]
total
数据总数
是
[number]
获取页面列表
GET
/openapi/2023-10/pages
权限要求:read_content
Headers
Authorization
String
Authorization
Accept
String
Accept
{
"data": [
{
"ID": 306,
"post_date": "2021-11-08 10:35:05",
"post_date_gmt": "2021-11-08 02:35:05",
"post_modified": "2021-11-08 10:35:05",
"post_modified_gmt": "2021-11-08 02:35:05",
"title": "dwad",
"content": "<p>dawd</p>",
"status": "private",
"slug": "dwad",
"seo_title": null,
"seo_description": null,
"public_url": "http://shop.com/pages/dwad",
"base_url": "http://shop.com/pages",
"path": "/pages/dwad",
"update_date_gmt": "2021-11-08T02:35:05+00:00",
"template": "page"
},
],
"links": {
"first": "http://zyshop.frp.codefriend.top/openapi/2023-10/pages?page=1",
"last": "http://zyshop.frp.codefriend.top/openapi/2023-10/pages?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://zyshop.frp.codefriend.top/openapi/2023-10/pages",
"per_page": 25,
"to": 8,
"total": 8
}
}
获取单个页面详情
GET
/openapi/2023-10/pages/{id}
权限要求:read_content
Headers
Authorization
String
Authorization
Accept
String
Accept
Request Body
id
[int]
请求id
{
"ID": 302,
"post_date": "2021-11-08 10:21:47",
"post_date_gmt": "2021-11-08 02:21:47",
"post_modified": "2021-11-08 10:21:47",
"post_modified_gmt": "2021-11-08 02:21:47",
"title": "222",
"content": "333",
"status": "private",
"slug": "222-3",
"seo_title": null,
"seo_description": null,
"public_url": "http://shop.com/pages/222-3",
"base_url": "http://shop.com/pages",
"path": "/pages/222-3",
"update_date_gmt": "2021-11-08T02:21:47+00:00",
"template": "page"
}
更新页面信息
PUT
/openapi/2023-10/pages/{id}
权限要求:read_content
Headers
Authorization
String
Authorization
Accept
String
Accept
Request Body
id
int
页面id
title
String
标题
status
String
状态
content
String
内容
seo_title
String
SEO标题
seo_description
String
SEO描述
slug
String
每个页面的SLUG必须唯一
template
String
模板类型
{
"ID": 302,
"post_date": "2021-11-08 10:21:47",
"post_date_gmt": "2021-11-08 02:21:47",
"post_modified": "2021-11-10 12:58:12",
"post_modified_gmt": "2021-11-10 04:58:12",
"title": "terms of service",
"content": "333",
"status": "publish",
"slug": "222-3",
"seo_title": null,
"seo_description": null,
"public_url": "http://shop.com/pages/222-3",
"base_url": "http://shop.com/pages",
"path": "/pages/222-3",
"update_date_gmt": "2021-11-10T04:58:12+00:00",
"template": "page"
}
删除页面
DELETE
/openapi/2023-10/pages/{id}
权限要求:write_content
Headers
Authorization
String
Authorization
Accept
String
Accept
Request Body
id
int
页面id
{
// Response
}
创建页面
POST
/openapi/2023-10/pages
权限要求:write_content
Headers
Authorization
String
Authorization
Accept
String
Accept
Request Body
title
String
标题
content
String
内容
status
String
状态
template
String
模板类型
{
"post_modified_gmt": "2021-11-10 05:10:44",
"post_modified": "2021-11-10 13:10:44",
"post_date_gmt": "2021-11-10 05:10:44",
"post_date": "2021-11-10 13:10:44",
"ID": 307,
"title": "da",
"content": "<p>no content</p>",
"status": "publish",
"slug": "da",
"seo_title": null,
"seo_description": null,
"public_url": "http://shop.com/pages/da",
"base_url": "http://shop.com/pages",
"path": "/pages/da",
"update_date_gmt": "2021-11-10T05:10:44+00:00",
"template": "contact_page"
}
Last updated