スキーマ
スキーマはattachmentオブジェクトに存在するすべてのフィールドを定義しています。
datestring, datetime (ISO8601) |
The date the object was published, in the site's timezone. コンテキスト: |
date_gmtstring, datetime (ISO8601) |
The date the object was published, as GMT. コンテキスト: |
guidobject |
The globally unique identifier for the object. 読み取り専用 コンテキスト: |
idinteger |
Unique identifier for the object. 読み取り専用 コンテキスト: |
linkstring, uri |
URL to the object. 読み取り専用 コンテキスト: |
modifiedstring, datetime (ISO8601) |
The date the object was last modified, in the site's timezone. 読み取り専用 コンテキスト: |
modified_gmtstring, datetime (ISO8601) |
The date the object was last modified, as GMT. 読み取り専用 コンテキスト: |
slugstring |
An alphanumeric identifier for the object unique to its type. コンテキスト: |
statusstring |
A named status for the object. コンテキスト: 次のいずれか: |
typestring |
Type of Post for the object. 読み取り専用 コンテキスト: |
permalink_templatestring |
Permalink template for the object. 読み取り専用 コンテキスト: |
generated_slugstring |
Slug automatically generated from the object title. 読み取り専用 コンテキスト: |
titleobject |
The title for the object. コンテキスト: |
authorinteger |
The ID for the author of the object. コンテキスト: |
comment_statusstring |
Whether or not comments are open on the object. コンテキスト: 次のいずれか: |
ping_statusstring |
Whether or not the object can be pinged. コンテキスト: 次のいずれか: |
metaobject |
Meta fields. コンテキスト: |
templatestring |
The theme file to use to display the object. コンテキスト: |
alt_textstring |
Alternative text to display when attachment is not displayed. コンテキスト: |
captionobject |
The attachment caption. コンテキスト: |
descriptionobject |
The attachment description. コンテキスト: |
media_typestring |
Attachment type. 読み取り専用 コンテキスト: 次のいずれか: |
mime_typestring |
The attachment MIME type. 読み取り専用 コンテキスト: |
media_detailsobject |
Details about the media file, specific to its type. 読み取り専用 コンテキスト: |
postinteger |
The ID for the associated post of the attachment. コンテキスト: |
source_urlstring, uri |
URL to the original attachment file. 読み取り専用 コンテキスト: |
Example Request
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/media
Media一覧
引数
context |
Scope under which the request is made; determines fields present in response.
初期値: 次のいずれか: |
page |
Current page of the collection.
初期値: |
per_page |
Maximum number of items to be returned in result set.
初期値: |
search |
Limit results to those matching a string. |
after |
Limit response to posts published after a given ISO8601 compliant date. |
author |
Limit result set to posts assigned to specific authors.
初期値: |
author_exclude |
Ensure result set excludes posts assigned to specific authors.
初期値: |
before |
Limit response to posts published before a given ISO8601 compliant date. |
exclude |
Ensure result set excludes specific IDs.
初期値: |
include |
Limit result set to specific IDs.
初期値: |
offset |
Offset the result set by a specific number of items. |
order |
Order sort attribute ascending or descending.
初期値: 次のいずれか: |
orderby |
Sort collection by object attribute.
初期値: 次のいずれか: |
parent |
Limit result set to items with particular parent IDs.
初期値: |
parent_exclude |
Limit result set to all items except those of a particular parent ID.
初期値: |
slug |
Limit result set to posts with one or more specific slugs. |
status |
Limit result set to posts assigned one or more statuses.
初期値: |
media_type |
Limit result set to attachments of a particular media type. 次のいずれか: |
mime_type |
Limit result set to attachments of a particular MIME type. |
定義
GET /wp/v2/media
リクエスト例
$ curl http://demo.wp-api.org/wp-json/wp/v2/media
Mediaを取得する
引数
id |
Unique identifier for the object. |
context |
Scope under which the request is made; determines fields present in response.
初期値: 次のいずれか: |
定義
GET /wp/v2/media/<id>
リクエスト例
$ curl http://demo.wp-api.org/wp-json/wp/v2/media/<id>
Mediaを作成
引数
date |
The date the object was published, in the site's timezone. |
date_gmt |
The date the object was published, as GMT. |
slug |
An alphanumeric identifier for the object unique to its type. |
status |
A named status for the object. 次のいずれか: |
title |
The title for the object. |
author |
The ID for the author of the object. |
comment_status |
Whether or not comments are open on the object. 次のいずれか: |
ping_status |
Whether or not the object can be pinged. 次のいずれか: |
meta |
Meta fields. |
template |
The theme file to use to display the object. |
alt_text |
Alternative text to display when attachment is not displayed. |
caption |
The attachment caption. |
description |
The attachment description. |
post |
The ID for the associated post of the attachment. |
定義
POST /wp/v2/media
Mediaを更新する
引数
id |
Unique identifier for the object. |
date |
The date the object was published, in the site's timezone. |
date_gmt |
The date the object was published, as GMT. |
slug |
An alphanumeric identifier for the object unique to its type. |
status |
A named status for the object. 次のいずれか: |
title |
The title for the object. |
author |
The ID for the author of the object. |
comment_status |
Whether or not comments are open on the object. 次のいずれか: |
ping_status |
Whether or not the object can be pinged. 次のいずれか: |
meta |
Meta fields. |
template |
The theme file to use to display the object. |
alt_text |
Alternative text to display when attachment is not displayed. |
caption |
The attachment caption. |
description |
The attachment description. |
post |
The ID for the associated post of the attachment. |
定義
POST /wp/v2/media/<id>
リクエスト例
Mediaを削除
引数
id |
Unique identifier for the object. |
force |
Whether to bypass trash and force deletion. |
定義
DELETE /wp/v2/media/<id>
リクエスト例
$ curl -X DELETE http://demo.wp-api.org/wp-json/wp/v2/media/<id>