页面

页面属性

页面属性 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]

属性名说明必填类型

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/2021-08/pages

权限要求:read_content,write_content

Headers

NameTypeDescription

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://zyshop.frp.codefriend.top/pages/dwad",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/dwad",
            "update_date_gmt": "2021-11-08T02:35:05+00:00",
            "template": "page"
        },
        {
            "ID": 305,
            "post_date": "2021-11-08 10:22:26",
            "post_date_gmt": "2021-11-08 02:22:26",
            "post_modified": "2021-11-08 10:34:40",
            "post_modified_gmt": "2021-11-08 02:34:40",
            "title": "dawda",
            "content": "<p>vdsv</p>",
            "status": "private",
            "slug": "222-6",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/222-6",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222-6",
            "update_date_gmt": "2021-11-08T02:34:40+00:00",
            "template": "page"
        },
        {
            "ID": 304,
            "post_date": "2021-11-08 10:22:20",
            "post_date_gmt": "2021-11-08 02:22:20",
            "post_modified": "2021-11-08 10:22:20",
            "post_modified_gmt": "2021-11-08 02:22:20",
            "title": "222",
            "content": "333",
            "status": "private",
            "slug": "222-5",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/222-5",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222-5",
            "update_date_gmt": "2021-11-08T02:22:20+00:00",
            "template": "page"
        },
        {
            "ID": 303,
            "post_date": "2021-11-08 10:21:59",
            "post_date_gmt": "2021-11-08 02:21:59",
            "post_modified": "2021-11-08 10:21:59",
            "post_modified_gmt": "2021-11-08 02:21:59",
            "title": "222",
            "content": "333",
            "status": "private",
            "slug": "222-4",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/222-4",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222-4",
            "update_date_gmt": "2021-11-08T02:21:59+00:00",
            "template": "page"
        },
        {
            "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://zyshop.frp.codefriend.top/pages/222-3",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222-3",
            "update_date_gmt": "2021-11-08T02:21:47+00:00",
            "template": "page"
        },
        {
            "ID": 301,
            "post_date": "2021-11-08 10:19:56",
            "post_date_gmt": "2021-11-08 02:19:56",
            "post_modified": "2021-11-08 10:19:56",
            "post_modified_gmt": "2021-11-08 02:19:56",
            "title": "222",
            "content": "333",
            "status": "private",
            "slug": "222-2",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/222-2",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222-2",
            "update_date_gmt": "2021-11-08T02:19:56+00:00",
            "template": "page"
        },
        {
            "ID": 300,
            "post_date": "2021-11-08 10:19:10",
            "post_date_gmt": "2021-11-08 02:19:10",
            "post_modified": "2021-11-08 10:19:10",
            "post_modified_gmt": "2021-11-08 02:19:10",
            "title": "222",
            "content": "333",
            "status": "private",
            "slug": "222",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/222",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/222",
            "update_date_gmt": "2021-11-08T02:19:10+00:00",
            "template": "page"
        },
        {
            "ID": 299,
            "post_date": "2021-11-05 17:41:32",
            "post_date_gmt": "2021-11-05 09:41:32",
            "post_modified": "2021-11-05 17:42:32",
            "post_modified_gmt": "2021-11-05 09:42:32",
            "title": "dawdaw",
            "content": "<p>dawdwadawd</p>",
            "status": "publish",
            "slug": "dawdaw",
            "seo_title": null,
            "seo_description": null,
            "public_url": "http://zyshop.frp.codefriend.top/pages/dawdaw",
            "base_url": "http://zyshop.frp.codefriend.top/pages",
            "path": "/pages/dawdaw",
            "update_date_gmt": "2021-11-05T09:42:32+00:00",
            "template": "page"
        }
    ],
    "links": {
        "first": "http://zyshop.frp.codefriend.top/openapi/2021-08/pages?page=1",
        "last": "http://zyshop.frp.codefriend.top/openapi/2021-08/pages?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://zyshop.frp.codefriend.top/openapi/2021-08/pages",
        "per_page": 25,
        "to": 8,
        "total": 8
    }
}

获取单个页面详情

GET /openapi/2021-08/pages/{id}

权限要求:read_content,write_content

Headers

NameTypeDescription

Authorization

String

Authorization

Accept

String

Accept

Request Body

NameTypeDescription

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/2021-08/pages/{id}

权限要求:read_content,write_content

Headers

NameTypeDescription

Authorization

String

Authorization

Accept

String

Accept

Request Body

NameTypeDescription

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/2021-08/pages/{id}

权限要求:write_content

Headers

NameTypeDescription

Authorization

String

Authorization

Accept

String

Accept

Request Body

NameTypeDescription

id

int

页面id

{
    // Response
}

创建页面

POST /openapi/2021-08/pages

权限要求:write_content

Headers

NameTypeDescription

Authorization

String

Authorization

Accept

String

Accept

Request Body

NameTypeDescription

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