REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
/ * *
* DO NOT EDIT
* Auto - generated by test _build _wp _api _client _fixtures
* /
2017-02-15 18:58:14 +01:00
var mockedApiResponse = { } ;
/* jshint -W109 */
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . Schema = {
"name" : "Test Blog" ,
"description" : "Just another WordPress site" ,
2017-02-17 01:12:49 +01:00
"url" : "http://example.org" ,
"home" : "http://example.org" ,
2017-03-07 06:47:32 +01:00
"gmt_offset" : "0" ,
"timezone_string" : "" ,
2017-02-15 18:58:14 +01:00
"namespaces" : [
2017-02-17 01:12:49 +01:00
"oembed/1.0" ,
2020-10-15 03:58:28 +02:00
"wp/v2" ,
"wp-site-health/v1"
2017-02-15 18:58:14 +01:00
] ,
"authentication" : [ ] ,
"routes" : {
2017-02-17 01:12:49 +01:00
"/" : {
2017-02-15 18:58:14 +01:00
"namespace" : "" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/"
2017-02-15 18:58:14 +01:00
}
} ,
2020-10-20 21:08:48 +02:00
"/batch/v1" : {
"namespace" : "" ,
"methods" : [
"POST"
] ,
"endpoints" : [
{
"methods" : [
"POST"
] ,
"args" : {
"validation" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
2020-10-20 21:08:48 +02:00
"enum" : [
"require-all-validate" ,
"normal"
] ,
2020-10-20 22:17:20 +02:00
"default" : "normal" ,
"required" : false
2020-10-20 21:08:48 +02:00
} ,
"requests" : {
"type" : "array" ,
2020-10-20 22:17:20 +02:00
"maxItems" : 25 ,
2020-10-20 21:08:48 +02:00
"items" : {
"type" : "object" ,
"properties" : {
"method" : {
"type" : "string" ,
"enum" : [
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"default" : "POST"
} ,
"path" : {
"type" : "string" ,
"required" : true
} ,
"body" : {
"type" : "object" ,
"properties" : [ ] ,
"additionalProperties" : true
} ,
"headers" : {
"type" : "object" ,
"properties" : [ ] ,
"additionalProperties" : {
"type" : [
"string" ,
"array"
] ,
"items" : {
"type" : "string"
}
}
}
}
2020-10-20 22:17:20 +02:00
} ,
"required" : true
2020-10-20 21:08:48 +02:00
}
}
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/batch/v1"
}
]
}
} ,
2017-02-17 01:12:49 +01:00
"/oembed/1.0" : {
"namespace" : "oembed/1.0" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"namespace" : {
2020-10-20 22:17:20 +02:00
"default" : "oembed/1.0" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/oembed/1.0/embed" : {
"namespace" : "oembed/1.0" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"url" : {
2020-05-04 02:26:52 +02:00
"description" : "The URL of the resource for which to fetch oEmbed data." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"default" : "json" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"maxwidth" : {
2020-10-20 22:17:20 +02:00
"default" : 600 ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0/embed"
2017-02-15 18:58:14 +01:00
}
} ,
2017-05-11 20:18:00 +02:00
"/oembed/1.0/proxy" : {
"namespace" : "oembed/1.0" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"url" : {
"description" : "The URL of the resource for which to fetch oEmbed data." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : true
2017-05-11 20:18:00 +02:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"description" : "The oEmbed format to use." ,
"type" : "string" ,
2017-05-11 20:18:00 +02:00
"default" : "json" ,
"enum" : [
"json" ,
"xml"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"maxwidth" : {
"description" : "The maximum width of the embed frame in pixels." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 600 ,
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"maxheight" : {
"description" : "The maximum height of the embed frame in pixels." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"discover" : {
General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.
“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”
With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the `$new_whitelist_options` global variable) are removed. A new ticket has been opened to explore renaming the `$new_whitelist_options` variable (#50434).
Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.
Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.
Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.
git-svn-id: https://develop.svn.wordpress.org/trunk@48121 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-22 19:24:34 +02:00
"description" : "Whether to perform an oEmbed discovery request for unsanctioned providers." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"default" : true ,
"required" : false
2017-05-11 20:18:00 +02:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0/proxy"
2017-05-11 20:18:00 +02:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"namespace" : {
2020-10-20 22:17:20 +02:00
"default" : "wp/v2" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/posts" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"after" : {
"description" : "Limit response to posts published after a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "Limit result set to posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_exclude" : {
"description" : "Ensure result set excludes posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"before" : {
"description" : "Limit response to posts published before a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "date" ,
"enum" : [
2017-05-10 20:51:28 +02:00
"author" ,
2017-02-15 18:58:14 +01:00
"date" ,
"id" ,
"include" ,
2017-05-10 20:51:28 +02:00
"modified" ,
"parent" ,
"relevance" ,
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-05-10 20:51:28 +02:00
"title"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "Limit result set to posts with one or more specific slugs." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"default" : "publish" ,
"description" : "Limit result set to posts assigned one or more statuses." ,
"type" : "array" ,
"items" : {
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private" ,
"trash" ,
"auto-draft" ,
"inherit" ,
2018-04-13 02:53:31 +02:00
"request-pending" ,
"request-confirmed" ,
"request-failed" ,
"request-completed" ,
2017-02-15 18:58:14 +01:00
"any"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
2019-11-04 00:12:44 +01:00
"tax_relation" : {
2020-10-20 22:17:20 +02:00
"description" : "Limit result set based on relationship between multiple taxonomies." ,
"type" : "string" ,
2019-11-04 00:12:44 +01:00
"enum" : [
"AND" ,
"OR"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2019-11-04 00:12:44 +01:00
} ,
2017-02-15 18:58:14 +01:00
"categories" : {
"description" : "Limit result set to all items that have the specified term assigned in the categories taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"categories_exclude" : {
"description" : "Limit result set to all items except those that have the specified term assigned in the categories taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"tags" : {
"description" : "Limit result set to all items that have the specified term assigned in the tags taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"tags_exclude" : {
"description" : "Limit result set to all items except those that have the specified term assigned in the tags taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"sticky" : {
"description" : "Limit result set to items that are sticky." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"description" : "The format for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
2017-02-25 05:45:52 +01:00
"standard" ,
"aside" ,
"chat" ,
"gallery" ,
"link" ,
"image" ,
"quote" ,
"status" ,
"video" ,
"audio"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"sticky" : {
"description" : "Whether or not the object should be treated as sticky." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"categories" : {
"description" : "The terms assigned to the object in the category taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"tags" : {
"description" : "The terms assigned to the object in the post_tag taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/posts"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/posts/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "The password for the post if it is password protected." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"description" : "The format for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
2017-02-25 05:45:52 +01:00
"standard" ,
"aside" ,
"chat" ,
"gallery" ,
"link" ,
"image" ,
"quote" ,
"status" ,
"video" ,
"audio"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"sticky" : {
"description" : "Whether or not the object should be treated as sticky." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"categories" : {
"description" : "The terms assigned to the object in the category taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"tags" : {
"description" : "The terms assigned to the object in the post_tag taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
2020-02-10 05:10:09 +01:00
"description" : "Whether to bypass Trash and force deletion." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/posts/(?P<parent>[\\d]+)/revisions" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2018-08-28 14:22:48 +02:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2018-08-28 14:22:48 +02:00
"default" : "date" ,
"enum" : [
"date" ,
"id" ,
"include" ,
"relevance" ,
"slug" ,
"include_slugs" ,
"title"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/posts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as revisions do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2018-12-17 01:23:55 +01:00
"/wp/v2/posts/(?P<id>[\\d]+)/autosaves" : {
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"description" : "The format for the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"standard" ,
"aside" ,
"chat" ,
"gallery" ,
"link" ,
"image" ,
"quote" ,
"status" ,
"video" ,
"audio"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"sticky" : {
"description" : "Whether or not the object should be treated as sticky." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"categories" : {
"description" : "The terms assigned to the object in the category taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"tags" : {
"description" : "The terms assigned to the object in the post_tag taxonomy." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
}
]
} ,
"/wp/v2/posts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"id" : {
"description" : "The ID for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/pages" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"after" : {
"description" : "Limit response to posts published after a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "Limit result set to posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_exclude" : {
"description" : "Ensure result set excludes posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"before" : {
"description" : "Limit response to posts published before a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"menu_order" : {
"description" : "Limit result set to posts with a specific menu_order value." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "date" ,
"enum" : [
2017-05-10 20:51:28 +02:00
"author" ,
2017-02-15 18:58:14 +01:00
"date" ,
"id" ,
"include" ,
2017-05-10 20:51:28 +02:00
"modified" ,
"parent" ,
"relevance" ,
2017-02-15 18:58:14 +01:00
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-05-10 20:51:28 +02:00
"title" ,
2017-02-15 18:58:14 +01:00
"menu_order"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
2017-05-11 20:40:17 +02:00
"description" : "Limit result set to items with particular parent IDs." ,
2017-02-15 18:58:14 +01:00
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent_exclude" : {
"description" : "Limit result set to all items except those of a particular parent ID." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "Limit result set to posts with one or more specific slugs." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"default" : "publish" ,
"description" : "Limit result set to posts assigned one or more statuses." ,
"type" : "array" ,
"items" : {
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private" ,
"trash" ,
"auto-draft" ,
"inherit" ,
2018-04-13 02:53:31 +02:00
"request-pending" ,
"request-confirmed" ,
"request-failed" ,
"request-completed" ,
2017-02-15 18:58:14 +01:00
"any"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"menu_order" : {
"description" : "The order of the object in relation to other object of its type." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/pages"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/pages/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "The password for the post if it is password protected." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"menu_order" : {
"description" : "The order of the object in relation to other object of its type." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
2020-02-10 05:10:09 +01:00
"description" : "Whether to bypass Trash and force deletion." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/pages/(?P<parent>[\\d]+)/revisions" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2018-08-28 14:22:48 +02:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-08-28 14:22:48 +02:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2018-08-28 14:22:48 +02:00
"default" : "date" ,
"enum" : [
"date" ,
"id" ,
"include" ,
"relevance" ,
"slug" ,
"include_slugs" ,
"title"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/pages/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as revisions do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2018-12-17 01:23:55 +01:00
"/wp/v2/pages/(?P<id>[\\d]+)/autosaves" : {
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2018-12-17 01:23:55 +01:00
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"excerpt" : {
"description" : "The excerpt for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Excerpt for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML excerpt for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the excerpt is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"featured_media" : {
"description" : "The ID of the featured media for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"menu_order" : {
"description" : "The order of the object in relation to other object of its type." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
}
]
} ,
"/wp/v2/pages/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"id" : {
"description" : "The ID for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/media" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"after" : {
"description" : "Limit response to posts published after a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "Limit result set to posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_exclude" : {
"description" : "Ensure result set excludes posts assigned to specific authors." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"before" : {
"description" : "Limit response to posts published before a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "date" ,
"enum" : [
2017-05-10 20:51:28 +02:00
"author" ,
2017-02-15 18:58:14 +01:00
"date" ,
"id" ,
"include" ,
2017-05-10 20:51:28 +02:00
"modified" ,
"parent" ,
"relevance" ,
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-05-10 20:51:28 +02:00
"title"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
2017-05-11 20:40:17 +02:00
"description" : "Limit result set to items with particular parent IDs." ,
2017-02-15 18:58:14 +01:00
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent_exclude" : {
"description" : "Limit result set to all items except those of a particular parent ID." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "Limit result set to posts with one or more specific slugs." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"default" : "inherit" ,
"description" : "Limit result set to posts assigned one or more statuses." ,
"type" : "array" ,
"items" : {
"enum" : [
"inherit" ,
"private" ,
"trash"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"media_type" : {
2020-10-20 22:17:20 +02:00
"default" : null ,
"description" : "Limit result set to attachments of a particular media type." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"image" ,
"video" ,
"text" ,
"application" ,
"audio"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"mime_type" : {
2020-10-20 22:17:20 +02:00
"default" : null ,
2017-02-15 18:58:14 +01:00
"description" : "Limit result set to attachments of a particular MIME type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"alt_text" : {
"description" : "Alternative text to display when attachment is not displayed." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"caption" : {
"description" : "The attachment caption." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Caption for the attachment, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML caption for the attachment, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "The attachment description." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Description for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML description for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"description" : "The ID for the associated post of the attachment." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/media"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/media/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML title for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID for the author of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not comments are open on the object." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Whether or not the object can be pinged." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"alt_text" : {
"description" : "Alternative text to display when attachment is not displayed." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"caption" : {
"description" : "The attachment caption." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Caption for the attachment, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML caption for the attachment, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "The attachment description." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Description for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML description for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"description" : "The ID for the associated post of the attachment." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
2020-02-10 05:10:09 +01:00
"description" : "Whether to bypass Trash and force deletion." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
2019-10-07 19:04:49 +02:00
}
]
} ,
2019-10-08 06:00:25 +02:00
"/wp/v2/media/(?P<id>[\\d]+)/post-process" : {
2019-10-07 19:04:49 +02:00
"namespace" : "wp/v2" ,
"methods" : [
"POST"
] ,
"endpoints" : [
{
"methods" : [
"POST"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2019-10-07 19:04:49 +02:00
} ,
"action" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
2019-10-07 19:04:49 +02:00
"enum" : [
"create-image-subsizes"
] ,
2020-10-20 22:17:20 +02:00
"required" : true
2019-10-07 19:04:49 +02:00
}
}
2017-02-15 18:58:14 +01:00
}
]
} ,
2020-07-04 06:13:17 +02:00
"/wp/v2/media/(?P<id>[\\d]+)/edit" : {
"namespace" : "wp/v2" ,
"methods" : [
"POST"
] ,
"endpoints" : [
{
"methods" : [
"POST"
] ,
"args" : {
"rotation" : {
"description" : "The amount to rotate the image clockwise in degrees." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"minimum" : 0 ,
"exclusiveMinimum" : true ,
"maximum" : 360 ,
"exclusiveMaximum" : true ,
"required" : false
2020-07-04 06:13:17 +02:00
} ,
"x" : {
"description" : "As a percentage of the image, the x position to start the crop from." ,
2020-10-20 22:17:20 +02:00
"type" : "number" ,
"minimum" : 0 ,
"maximum" : 100 ,
"required" : false
2020-07-04 06:13:17 +02:00
} ,
"y" : {
"description" : "As a percentage of the image, the y position to start the crop from." ,
2020-10-20 22:17:20 +02:00
"type" : "number" ,
"minimum" : 0 ,
"maximum" : 100 ,
"required" : false
2020-07-04 06:13:17 +02:00
} ,
"width" : {
"description" : "As a percentage of the image, the width to crop the image to." ,
2020-10-20 22:17:20 +02:00
"type" : "number" ,
"minimum" : 0 ,
"maximum" : 100 ,
"required" : false
2020-07-04 06:13:17 +02:00
} ,
"height" : {
"description" : "As a percentage of the image, the height to crop the image to." ,
2020-10-20 22:17:20 +02:00
"type" : "number" ,
"minimum" : 0 ,
"maximum" : 100 ,
"required" : false
2020-07-16 23:54:37 +02:00
} ,
"src" : {
"description" : "URL to the edited image file." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : true
2020-07-04 06:13:17 +02:00
}
}
}
]
} ,
2018-12-14 03:34:28 +01:00
"/wp/v2/blocks" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"after" : {
"description" : "Limit response to posts published after a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"before" : {
"description" : "Limit response to posts published before a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"default" : "date" ,
"enum" : [
"author" ,
"date" ,
"id" ,
"include" ,
"modified" ,
"parent" ,
"relevance" ,
"slug" ,
"include_slugs" ,
"title"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"slug" : {
"description" : "Limit result set to posts with one or more specific slugs." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"status" : {
"default" : "publish" ,
"description" : "Limit result set to posts assigned one or more statuses." ,
"type" : "array" ,
"items" : {
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private" ,
"trash" ,
"auto-draft" ,
"inherit" ,
"request-pending" ,
"request-confirmed" ,
"request-failed" ,
"request-completed" ,
"any"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
}
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
}
] ,
"_links" : {
"self" : "http://example.org/index.php?rest_route=/wp/v2/blocks"
}
} ,
"/wp/v2/blocks/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"password" : {
"description" : "The password for the post if it is password protected." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
}
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2018-12-14 03:34:28 +01:00
"default" : false ,
2020-02-10 05:10:09 +01:00
"description" : "Whether to bypass Trash and force deletion." ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
}
}
}
]
} ,
2018-12-17 01:23:55 +01:00
"/wp/v2/blocks/(?P<id>[\\d]+)/autosaves" : {
2018-12-14 03:34:28 +01:00
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2019-09-23 19:24:58 +02:00
"type" : [
"string" ,
"null"
2020-10-20 22:17:20 +02:00
] ,
"format" : "date-time" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
2018-12-17 01:23:55 +01:00
"slug" : {
"description" : "An alphanumeric identifier for the object unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
2018-12-17 01:23:55 +01:00
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "A named status for the object." ,
"type" : "string" ,
2018-12-17 01:23:55 +01:00
"enum" : [
"publish" ,
"future" ,
"draft" ,
"pending" ,
"private"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-14 03:34:28 +01:00
} ,
2018-12-17 01:23:55 +01:00
"password" : {
"description" : "A password to protect access to the content and excerpt." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"title" : {
"description" : "The title for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Title for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
}
} ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"view" ,
"edit"
]
} ,
"block_version" : {
"description" : "Version of the content block format used by the object." ,
"type" : "integer" ,
"context" : [
"edit"
] ,
"readonly" : true
} ,
"protected" : {
"description" : "Whether the content is protected with a password." ,
"type" : "boolean" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2018-12-17 01:23:55 +01:00
} ,
"template" : {
"description" : "The theme file to use to display the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
}
]
} ,
"/wp/v2/blocks/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"id" : {
"description" : "The ID for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/types" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/types"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/types/(?P<type>[\\w-]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"type" : {
"description" : "An alphanumeric identifier for the post type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/statuses" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/statuses"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/statuses/(?P<status>[\\w-]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"status" : {
"description" : "An alphanumeric identifier for the status." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/taxonomies" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"type" : {
"description" : "Limit results to taxonomies associated with a specific post type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/taxonomies"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/taxonomies/(?P<taxonomy>[\\w-]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"taxonomy" : {
"description" : "An alphanumeric identifier for the taxonomy." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/categories" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "asc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by term attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "name" ,
"enum" : [
"id" ,
"include" ,
"name" ,
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-02-15 18:58:14 +01:00
"term_group" ,
"description" ,
"count"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"hide_empty" : {
"description" : "Whether to hide terms not assigned to any posts." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"default" : false ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "Limit result set to terms assigned to a specific parent." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"description" : "Limit result set to terms assigned to a specific post." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : null ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
2017-04-06 00:24:24 +02:00
"description" : "Limit result set to terms with one or more specific slugs." ,
2017-04-05 22:24:27 +02:00
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"description" : {
"description" : "HTML description of the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "HTML title for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the term unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "The parent term ID." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/categories"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/categories/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "HTML description of the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "HTML title for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the term unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "The parent term ID." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as terms do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/tags" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "asc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by term attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "name" ,
"enum" : [
"id" ,
"include" ,
"name" ,
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-02-15 18:58:14 +01:00
"term_group" ,
"description" ,
"count"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"hide_empty" : {
"description" : "Whether to hide terms not assigned to any posts." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"default" : false ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"description" : "Limit result set to terms assigned to a specific post." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : null ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
2017-04-06 00:24:24 +02:00
"description" : "Limit result set to terms with one or more specific slugs." ,
2017-04-05 22:24:27 +02:00
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"description" : {
"description" : "HTML description of the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "HTML title for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the term unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/tags"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/tags/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "HTML description of the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "HTML title for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the term unique to its type." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the term." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as terms do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/users" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
"default" : "asc" ,
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
2017-02-15 18:58:14 +01:00
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
"default" : "name" ,
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
2017-02-15 18:58:14 +01:00
"enum" : [
"id" ,
"include" ,
"name" ,
"registered_date" ,
"slug" ,
2017-10-05 02:36:43 +02:00
"include_slugs" ,
2017-02-15 18:58:14 +01:00
"email" ,
"url"
] ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
2017-04-06 00:24:24 +02:00
"description" : "Limit result set to users with one or more specific slugs." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"roles" : {
"description" : "Limit result set to users matching at least one specific role provided. Accepts csv list or single role." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2018-04-25 15:05:48 +02:00
} ,
"who" : {
2020-10-20 22:17:20 +02:00
"description" : "Limit result set to users who are considered authors." ,
"type" : "string" ,
2018-04-25 15:05:48 +02:00
"enum" : [
"authors"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"username" : {
"description" : "Login name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "Display name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"first_name" : {
"description" : "First name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"last_name" : {
"description" : "Last name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"email" : {
"description" : "The email address for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"url" : {
"description" : "URL of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "Description of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"locale" : {
2020-10-20 22:17:20 +02:00
"description" : "Locale for the user." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"" ,
"en_US" ,
"de_DE" ,
"en_GB" ,
2018-06-16 14:44:46 +02:00
"es_ES" ,
"ja_JP"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"nickname" : {
"description" : "The nickname for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"roles" : {
"description" : "Roles assigned to the user." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "Password for the user (never included)." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/users"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/users/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"username" : {
"description" : "Login name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "Display name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"first_name" : {
"description" : "First name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"last_name" : {
"description" : "Last name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"email" : {
"description" : "The email address for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"url" : {
"description" : "URL of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "Description of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"locale" : {
2020-10-20 22:17:20 +02:00
"description" : "Locale for the user." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"" ,
"en_US" ,
"de_DE" ,
"en_GB" ,
2018-06-16 14:44:46 +02:00
"es_ES" ,
"ja_JP"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"nickname" : {
"description" : "The nickname for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"roles" : {
"description" : "Roles assigned to the user." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "Password for the user (never included)." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as users do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"reassign" : {
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
2017-02-15 18:58:14 +01:00
"description" : "Reassign the deleted user's posts and links to this user ID." ,
2020-10-20 22:17:20 +02:00
"required" : true
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/users/me" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"username" : {
"description" : "Login name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"name" : {
"description" : "Display name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"first_name" : {
"description" : "First name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"last_name" : {
"description" : "Last name for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"email" : {
"description" : "The email address for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"url" : {
"description" : "URL of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "Description of the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"locale" : {
2020-10-20 22:17:20 +02:00
"description" : "Locale for the user." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"" ,
"en_US" ,
"de_DE" ,
"en_GB" ,
2018-06-16 14:44:46 +02:00
"es_ES" ,
"ja_JP"
2017-02-15 18:58:14 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"nickname" : {
"description" : "The nickname for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"slug" : {
"description" : "An alphanumeric identifier for the user." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"roles" : {
"description" : "Roles assigned to the user." ,
"type" : "array" ,
"items" : {
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "Password for the user (never included)." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
"description" : "Required to be true, as users do not support trashing." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"reassign" : {
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
2017-02-15 18:58:14 +01:00
"description" : "Reassign the deleted user's posts and links to this user ID." ,
2020-10-20 22:17:20 +02:00
"required" : true
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/users/me"
2017-02-15 18:58:14 +01:00
}
} ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
"/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
2020-10-22 17:04:23 +02:00
"app_id" : {
"description" : "A machine-readable string provided by the application to uniquely identify it." ,
"type" : "string" ,
"required" : false
} ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
"name" : {
"description" : "The name of the application password." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : true
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : [ ]
}
]
} ,
"/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords/(?P<uuid>[\\w\\-]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
2020-10-22 17:04:23 +02:00
"app_id" : {
"description" : "A machine-readable string provided by the application to uniquely identify it." ,
"type" : "string" ,
"required" : false
} ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
"name" : {
"description" : "The name of the application password." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 00:12:02 +02:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : [ ]
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/comments" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"after" : {
"description" : "Limit response to comments published after a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "Limit result set to comments assigned to specific user IDs. Requires authorization." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_exclude" : {
"description" : "Ensure result set excludes comments assigned to specific user IDs. Requires authorization." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_email" : {
2020-10-20 22:17:20 +02:00
"default" : null ,
2017-02-15 18:58:14 +01:00
"description" : "Limit result set to that from a specific author email. Requires authorization." ,
2020-10-20 22:17:20 +02:00
"format" : "email" ,
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"before" : {
"description" : "Limit response to comments published before a given ISO8601 compliant date." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"exclude" : {
"description" : "Ensure result set excludes specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"include" : {
"description" : "Limit result set to specific IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"default" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"offset" : {
"description" : "Offset the result set by a specific number of items." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"order" : {
2020-10-20 22:17:20 +02:00
"description" : "Order sort attribute ascending or descending." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "desc" ,
"enum" : [
"asc" ,
"desc"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"orderby" : {
2020-10-20 22:17:20 +02:00
"description" : "Sort collection by object attribute." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"default" : "date_gmt" ,
"enum" : [
"date" ,
"date_gmt" ,
"id" ,
"include" ,
"post" ,
"parent" ,
"type"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"default" : [ ] ,
"description" : "Limit result set to comments of specific parent IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent_exclude" : {
"default" : [ ] ,
"description" : "Ensure result set excludes specific parent IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"default" : [ ] ,
"description" : "Limit result set to comments assigned to specific post IDs." ,
"type" : "array" ,
"items" : {
"type" : "integer"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"default" : "approve" ,
"description" : "Limit result set to comments assigned a specific status. Requires authorization." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"type" : {
"default" : "comment" ,
"description" : "Limit result set to comments assigned a specific type. Requires authorization." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
"description" : "The password for the post if it is password protected." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"author" : {
"description" : "The ID of the user object, if author was a user." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_email" : {
"description" : "Email address for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_ip" : {
"description" : "IP address for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "ip" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_name" : {
"description" : "Display name for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_url" : {
"description" : "URL for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_user_agent" : {
"description" : "User agent for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"default" : 0 ,
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"default" : 0 ,
"description" : "The ID of the associated post object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"description" : "State of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/comments"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/comments/(?P<id>[\\d]+)" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
2017-05-11 20:40:17 +02:00
"description" : "The password for the parent post of the comment (if the post is password protected)." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author" : {
"description" : "The ID of the user object, if author was a user." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_email" : {
"description" : "Email address for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_ip" : {
"description" : "IP address for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "ip" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_name" : {
"description" : "Display name for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_url" : {
"description" : "URL for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"author_user_agent" : {
"description" : "User agent for the object author." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"content" : {
"description" : "The content for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : {
"raw" : {
"description" : "Content for the object, as it exists in the database." ,
"type" : "string" ,
"context" : [
"edit"
]
} ,
"rendered" : {
"description" : "HTML content for the object, transformed for display." ,
"type" : "string" ,
"context" : [
"view" ,
"edit" ,
"embed"
] ,
"readonly" : true
}
} ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date" : {
"description" : "The date the object was published, in the site's timezone." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_gmt" : {
"description" : "The date the object was published, as GMT." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "date-time" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"parent" : {
"description" : "The ID for the parent of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"post" : {
"description" : "The ID of the associated post object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"status" : {
"description" : "State of the object." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"meta" : {
"description" : "Meta fields." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"properties" : [ ] ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"id" : {
"description" : "Unique identifier for the object." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"force" : {
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
2017-02-15 18:58:14 +01:00
"default" : false ,
2020-02-10 05:10:09 +01:00
"description" : "Whether to bypass Trash and force deletion." ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"password" : {
2017-05-11 20:40:17 +02:00
"description" : "The password for the parent post of the comment (if the post is password protected)." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
]
} ,
2018-12-13 10:37:05 +01:00
"/wp/v2/search" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-13 10:37:05 +01:00
"enum" : [
"view" ,
"embed"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-13 10:37:05 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2018-12-13 10:37:05 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2018-12-13 10:37:05 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-13 10:37:05 +01:00
} ,
"type" : {
"default" : "post" ,
2020-10-20 22:17:20 +02:00
"description" : "Limit results to items of an object type." ,
"type" : "string" ,
2018-12-13 10:37:05 +01:00
"enum" : [
2020-10-08 03:30:25 +02:00
"post" ,
2020-10-12 21:52:57 +02:00
"term" ,
"post-format"
2018-12-13 10:37:05 +01:00
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2018-12-13 10:37:05 +01:00
} ,
"subtype" : {
"default" : "any" ,
"description" : "Limit results to items of one or more object subtypes." ,
"type" : "array" ,
"items" : {
"enum" : [
"post" ,
"page" ,
2020-10-08 03:30:25 +02:00
"category" ,
"post_tag" ,
2018-12-13 10:37:05 +01:00
"any"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : false
2018-12-13 10:37:05 +01:00
}
}
}
] ,
"_links" : {
"self" : "http://example.org/index.php?rest_route=/wp/v2/search"
}
} ,
2020-06-17 05:20:02 +02:00
"/wp/v2/block-renderer/(?P<name>[a-z0-9-]+/[a-z0-9-]+)" : {
2018-12-14 03:34:28 +01:00
"namespace" : "wp/v2" ,
"methods" : [
2020-05-04 02:26:52 +02:00
"GET" ,
"POST"
2018-12-14 03:34:28 +01:00
] ,
"endpoints" : [
{
"methods" : [
2020-05-04 02:26:52 +02:00
"GET" ,
"POST"
2018-12-14 03:34:28 +01:00
] ,
"args" : {
"name" : {
"description" : "Unique registered name for the block." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2018-12-14 03:34:28 +01:00
"enum" : [
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2018-12-14 03:34:28 +01:00
} ,
"attributes" : {
2020-09-22 00:52:29 +02:00
"description" : "Attributes for the block." ,
2020-10-20 22:17:20 +02:00
"type" : "object" ,
"default" : [ ] ,
"required" : false
2019-03-07 12:53:15 +01:00
} ,
"post_id" : {
2018-12-14 03:34:28 +01:00
"description" : "ID of the post context." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2018-12-14 03:34:28 +01:00
}
}
}
]
} ,
2020-06-26 02:44:44 +02:00
"/wp/v2/block-types" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2020-06-26 02:44:44 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2020-06-26 02:44:44 +02:00
} ,
"namespace" : {
"description" : "Block namespace." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2020-06-26 02:44:44 +02:00
}
}
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/block-types"
}
]
}
} ,
"/wp/v2/block-types/(?P<namespace>[a-zA-Z0-9_-]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2020-06-26 02:44:44 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2020-06-26 02:44:44 +02:00
} ,
"namespace" : {
"description" : "Block namespace." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2020-06-26 02:44:44 +02:00
}
}
}
]
} ,
"/wp/v2/block-types/(?P<namespace>[a-zA-Z0-9_-]+)/(?P<name>[a-zA-Z0-9_-]+)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"name" : {
2020-09-22 00:52:29 +02:00
"description" : "Block name." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2020-06-26 02:44:44 +02:00
} ,
"namespace" : {
2020-09-22 00:52:29 +02:00
"description" : "Block namespace." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2020-06-26 02:44:44 +02:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
2020-06-26 02:44:44 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2020-06-26 02:44:44 +02:00
}
}
}
]
} ,
2017-02-17 01:12:49 +01:00
"/wp/v2/settings" : {
"namespace" : "wp/v2" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : [ ]
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"title" : {
"description" : "Site title." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"description" : {
"description" : "Site tagline." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"url" : {
"description" : "Site URL." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"email" : {
"description" : "This address is used for admin purposes, like new user notification." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "email" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"timezone" : {
"description" : "A city in the same timezone as you." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"date_format" : {
"description" : "A date format for all date strings." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"time_format" : {
"description" : "A time format for all time strings." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"start_of_week" : {
"description" : "A day number of the week that the week should start on." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"language" : {
"description" : "WordPress locale code." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"use_smilies" : {
"description" : "Convert emoticons like :-) and :-P to graphics on display." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"default_category" : {
"description" : "Default post category." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"default_post_format" : {
"description" : "Default post format." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"posts_per_page" : {
"description" : "Blog pages show at most." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"default_ping_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Allow link notifications from other blogs (pingbacks and trackbacks) on new articles." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"default_comment_status" : {
2020-10-20 22:17:20 +02:00
"description" : "Allow people to submit comments on new posts." ,
"type" : "string" ,
2017-02-15 18:58:14 +01:00
"enum" : [
"open" ,
"closed"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/wp/v2/settings"
2017-02-15 18:58:14 +01:00
}
2018-12-12 04:32:21 +01:00
} ,
"/wp/v2/themes" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
"description" : "Scope under which the request is made; determines fields present in response." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-12 04:32:21 +01:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
2018-12-12 04:32:21 +01:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
2018-12-12 04:32:21 +01:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
2018-12-12 04:32:21 +01:00
} ,
"status" : {
"description" : "Limit result set to themes assigned one or more statuses." ,
"type" : "array" ,
"items" : {
"enum" : [
"active"
] ,
"type" : "string"
2020-10-20 22:17:20 +02:00
} ,
"required" : true
2018-12-12 04:32:21 +01:00
}
}
}
] ,
"_links" : {
"self" : "http://example.org/index.php?rest_route=/wp/v2/themes"
}
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"/wp/v2/plugins" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"search" : {
"description" : "Limit results to those matching a string." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"status" : {
"description" : "Limits results to plugins with the given status." ,
"type" : "array" ,
"items" : {
"type" : "string" ,
"enum" : [
"inactive" ,
"active"
]
2020-10-20 22:17:20 +02:00
} ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
} ,
{
"methods" : [
"POST"
] ,
"args" : {
"slug" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"description" : "WordPress.org plugin directory slug." ,
2020-10-20 22:17:20 +02:00
"pattern" : "[\\w\\-]+" ,
"required" : true
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "The plugin activation status." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"inactive" ,
"active"
] ,
2020-10-20 22:17:20 +02:00
"default" : "inactive" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/plugins"
}
]
}
} ,
"/wp/v2/plugins/(?P<plugin>[^.\\/]+(?:\\/[^.\\/]+)?)" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET" ,
"POST" ,
"PUT" ,
"PATCH" ,
"DELETE"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"plugin" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"pattern" : "[^.\\/]+(?:\\/[^.\\/]+)?" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
} ,
{
"methods" : [
"POST" ,
"PUT" ,
"PATCH"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"plugin" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"pattern" : "[^.\\/]+(?:\\/[^.\\/]+)?" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"status" : {
2020-10-20 22:17:20 +02:00
"description" : "The plugin activation status." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"inactive" ,
"active"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
} ,
{
"methods" : [
"DELETE"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"view" ,
"embed" ,
"edit"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"plugin" : {
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"pattern" : "[^.\\/]+(?:\\/[^.\\/]+)?" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
}
]
} ,
"/wp/v2/block-directory/search" : {
"namespace" : "wp/v2" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"context" : {
2020-10-20 22:17:20 +02:00
"description" : "Scope under which the request is made; determines fields present in response." ,
"type" : "string" ,
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
"enum" : [
"view"
] ,
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"page" : {
"description" : "Current page of the collection." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 1 ,
"minimum" : 1 ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"per_page" : {
"description" : "Maximum number of items to be returned in result set." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 10 ,
"minimum" : 1 ,
"maximum" : 100 ,
"required" : false
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
} ,
"term" : {
"description" : "Limit result set to blocks matching the search term." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"minLength" : 1 ,
"required" : true
REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.
Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.
git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:22:25 +02:00
}
}
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/block-directory/search"
}
]
}
2020-10-15 03:58:28 +02:00
} ,
"/wp-site-health/v1" : {
"namespace" : "wp-site-health/v1" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"namespace" : {
2020-10-20 22:17:20 +02:00
"default" : "wp-site-health/v1" ,
"required" : false
2020-10-15 03:58:28 +02:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2020-10-15 03:58:28 +02:00
}
}
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp-site-health/v1"
}
]
}
} ,
"/wp-site-health/v1/tests/background-updates" : {
"namespace" : "wp-site-health/v1" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : [ ]
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp-site-health/v1/tests/background-updates"
}
]
}
} ,
"/wp-site-health/v1/tests/loopback-requests" : {
"namespace" : "wp-site-health/v1" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : [ ]
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp-site-health/v1/tests/loopback-requests"
}
]
}
} ,
"/wp-site-health/v1/tests/dotorg-communication" : {
"namespace" : "wp-site-health/v1" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : [ ]
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp-site-health/v1/tests/dotorg-communication"
}
]
}
} ,
"/wp-site-health/v1/directory-sizes" : {
"namespace" : "wp-site-health/v1" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : [ ]
}
] ,
"_links" : {
"self" : [
{
"href" : "http://example.org/index.php?rest_route=/wp-site-health/v1/directory-sizes"
}
]
}
2017-02-15 18:58:14 +01:00
}
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . oembed = {
2017-02-17 01:12:49 +01:00
"namespace" : "oembed/1.0" ,
2017-02-15 18:58:14 +01:00
"routes" : {
2017-02-17 01:12:49 +01:00
"/oembed/1.0" : {
"namespace" : "oembed/1.0" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"namespace" : {
2020-10-20 22:17:20 +02:00
"default" : "oembed/1.0" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"context" : {
2020-10-20 22:17:20 +02:00
"default" : "view" ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0"
2017-02-15 18:58:14 +01:00
}
} ,
2017-02-17 01:12:49 +01:00
"/oembed/1.0/embed" : {
"namespace" : "oembed/1.0" ,
2017-02-15 18:58:14 +01:00
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"url" : {
2020-05-04 02:26:52 +02:00
"description" : "The URL of the resource for which to fetch oEmbed data." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : true
2017-02-15 18:58:14 +01:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"default" : "json" ,
"required" : false
2017-02-15 18:58:14 +01:00
} ,
"maxwidth" : {
2020-10-20 22:17:20 +02:00
"default" : 600 ,
"required" : false
2017-02-15 18:58:14 +01:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0/embed"
2017-02-15 18:58:14 +01:00
}
2017-05-11 20:18:00 +02:00
} ,
"/oembed/1.0/proxy" : {
"namespace" : "oembed/1.0" ,
"methods" : [
"GET"
] ,
"endpoints" : [
{
"methods" : [
"GET"
] ,
"args" : {
"url" : {
"description" : "The URL of the resource for which to fetch oEmbed data." ,
2020-10-20 22:17:20 +02:00
"type" : "string" ,
"format" : "uri" ,
"required" : true
2017-05-11 20:18:00 +02:00
} ,
"format" : {
2020-10-20 22:17:20 +02:00
"description" : "The oEmbed format to use." ,
"type" : "string" ,
2017-05-11 20:18:00 +02:00
"default" : "json" ,
"enum" : [
"json" ,
"xml"
] ,
2020-10-20 22:17:20 +02:00
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"maxwidth" : {
"description" : "The maximum width of the embed frame in pixels." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"default" : 600 ,
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"maxheight" : {
"description" : "The maximum height of the embed frame in pixels." ,
2020-10-20 22:17:20 +02:00
"type" : "integer" ,
"required" : false
2017-05-11 20:18:00 +02:00
} ,
"discover" : {
General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.
“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”
With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the `$new_whitelist_options` global variable) are removed. A new ticket has been opened to explore renaming the `$new_whitelist_options` variable (#50434).
Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.
Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.
Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.
git-svn-id: https://develop.svn.wordpress.org/trunk@48121 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-22 19:24:34 +02:00
"description" : "Whether to perform an oEmbed discovery request for unsanctioned providers." ,
2020-10-20 22:17:20 +02:00
"type" : "boolean" ,
"default" : true ,
"required" : false
2017-05-11 20:18:00 +02:00
}
}
}
] ,
"_links" : {
2017-07-25 02:49:22 +02:00
"self" : "http://example.org/index.php?rest_route=/oembed/1.0/proxy"
2017-05-11 20:18:00 +02:00
}
2017-02-15 18:58:14 +01:00
}
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . oembeds = {
2017-05-11 20:31:26 +02:00
"version" : "1.0" ,
"provider_name" : "Test Blog" ,
"provider_url" : "http://example.org" ,
"author_name" : "Test Blog" ,
"author_url" : "http://example.org" ,
"title" : "REST API Client Fixture: Post" ,
"type" : "rich" ,
"width" : 600 ,
"height" : 338 ,
2017-07-05 11:29:58 +02:00
"html" : "<blockquote class=\"wp-embedded-content\">...</blockquote>..."
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-05-11 20:18:00 +02:00
mockedApiResponse . oembedProxy = {
2017-05-11 20:31:26 +02:00
"version" : "1.0" ,
"type" : "video" ,
"provider_name" : "YouTube" ,
"provider_url" : "https://www.youtube.com" ,
"thumbnail_width" : 480 ,
"width" : 500 ,
"thumbnail_height" : 360 ,
2019-03-20 18:21:56 +01:00
"html" : "<iframe title=\"No te olvides de poner el Where en el Delete From. (Una cancion para programadores)\" width=\"500\" height=\"375\" src=\"https://www.youtube.com/embed/i_cVJgIz_Cs?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>" ,
2017-05-11 20:31:26 +02:00
"author_name" : "Jorge Rubira Santos" ,
"thumbnail_url" : "https://i.ytimg.com/vi/i_cVJgIz_Cs/hqdefault.jpg" ,
"title" : "No te olvides de poner el Where en el Delete From. (Una cancion para programadores)" ,
"height" : 375
2017-05-11 20:18:00 +02:00
} ;
2017-02-15 18:58:14 +01:00
mockedApiResponse . PostsCollection = [
{
2018-07-13 06:45:35 +02:00
"id" : 4 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-07-13 06:45:35 +02:00
"rendered" : "http://example.org/?p=4"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-post" ,
2017-02-19 05:31:12 +01:00
"status" : "publish" ,
2017-02-15 18:58:14 +01:00
"type" : "post" ,
2018-07-13 06:45:35 +02:00
"link" : "http://example.org/?p=4" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Post"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated post content.</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Post</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"author" : 0 ,
"featured_media" : 0 ,
"comment_status" : "open" ,
"ping_status" : "open" ,
"sticky" : false ,
"template" : "" ,
"format" : "standard" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : "meta_value"
} ,
2017-02-15 18:58:14 +01:00
"categories" : [
1
] ,
"tags" : [ ] ,
"_links" : {
"self" : [
{
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts"
2017-02-15 18:58:14 +01:00
}
] ,
"about" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types/post"
2017-02-15 18:58:14 +01:00
}
] ,
"replies" : [
{
"embeddable" : true ,
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4"
2017-02-15 18:58:14 +01:00
}
] ,
"version-history" : [
{
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"count" : 2 ,
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions"
2017-02-15 18:58:14 +01:00
}
] ,
2018-07-13 06:06:23 +02:00
"predecessor-version" : [
{
2018-12-16 02:37:56 +01:00
"id" : 6 ,
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions/6"
2018-07-13 06:06:23 +02:00
}
] ,
2017-02-15 18:58:14 +01:00
"wp:attachment" : [
{
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:term" : [
{
"taxonomy" : "category" ,
"embeddable" : true ,
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4"
2017-02-15 18:58:14 +01:00
} ,
{
"taxonomy" : "post_tag" ,
"embeddable" : true ,
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . PostModel = {
2018-07-13 06:45:35 +02:00
"id" : 4 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-07-13 06:45:35 +02:00
"rendered" : "http://example.org/?p=4"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-post" ,
2017-02-19 05:31:12 +01:00
"status" : "publish" ,
2017-02-15 18:58:14 +01:00
"type" : "post" ,
2018-07-13 06:45:35 +02:00
"link" : "http://example.org/?p=4" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Post"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated post content.</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Post</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"author" : 0 ,
"featured_media" : 0 ,
"comment_status" : "open" ,
"ping_status" : "open" ,
"sticky" : false ,
"template" : "" ,
"format" : "standard" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : "meta_value"
} ,
2017-02-15 18:58:14 +01:00
"categories" : [
1
] ,
"tags" : [ ]
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . postRevisions = [
{
2017-05-11 20:31:26 +02:00
"author" : 2 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 6 ,
2017-02-15 18:58:14 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-07-13 06:45:35 +02:00
"parent" : 4 ,
2018-12-16 02:37:56 +01:00
"slug" : "4-autosave-v1" ,
2017-02-15 18:58:14 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=6"
2017-02-15 18:58:14 +01:00
} ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave post content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
} ,
"_links" : {
"parent" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4"
}
]
}
} ,
{
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 5 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 4 ,
"slug" : "4-revision-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=5"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Post"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated post content.</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Post</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"_links" : {
"parent" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4"
2017-02-15 18:58:14 +01:00
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . revision = {
2017-05-11 20:31:26 +02:00
"author" : 2 ,
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-07-13 06:45:35 +02:00
"id" : 5 ,
2017-05-11 20:31:26 +02:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-07-13 06:45:35 +02:00
"parent" : 4 ,
"slug" : "4-revision-v1" ,
2017-05-11 20:31:26 +02:00
"guid" : {
2018-07-13 06:45:35 +02:00
"rendered" : "http://example.org/?p=5"
2017-05-11 20:31:26 +02:00
} ,
"title" : {
"rendered" : "REST API Client Fixture: Post"
} ,
"content" : {
"rendered" : "<p>Updated post content.</p>\n"
} ,
"excerpt" : {
"rendered" : "<p>REST API Client Fixture: Post</p>\n"
2017-02-15 18:58:14 +01:00
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
mockedApiResponse . postAutosaves = [
{
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 6 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 4 ,
"slug" : "4-autosave-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=6"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave post content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
} ,
"_links" : {
"parent" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
]
}
}
] ;
mockedApiResponse . autosave = {
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 6 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 4 ,
"slug" : "4-autosave-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=6"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave post content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
}
} ;
2017-02-15 18:58:14 +01:00
mockedApiResponse . PagesCollection = [
{
2018-12-16 02:37:56 +01:00
"id" : 7 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?page_id=7"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-page" ,
2017-02-19 05:31:12 +01:00
"status" : "publish" ,
2017-02-15 18:58:14 +01:00
"type" : "page" ,
2018-12-16 02:37:56 +01:00
"link" : "http://example.org/?page_id=7" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Page"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated page content.</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Page</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"author" : 0 ,
"featured_media" : 0 ,
"parent" : 0 ,
"menu_order" : 0 ,
"comment_status" : "closed" ,
"ping_status" : "closed" ,
"template" : "" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages"
2017-02-15 18:58:14 +01:00
}
] ,
"about" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types/page"
2017-02-15 18:58:14 +01:00
}
] ,
"replies" : [
{
"embeddable" : true ,
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"
2017-02-15 18:58:14 +01:00
}
] ,
"version-history" : [
{
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"count" : 2 ,
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7/revisions"
2017-02-15 18:58:14 +01:00
}
] ,
2018-07-13 06:06:23 +02:00
"predecessor-version" : [
{
2018-12-16 02:37:56 +01:00
"id" : 9 ,
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7/revisions/9"
2018-07-13 06:06:23 +02:00
}
] ,
2017-02-15 18:58:14 +01:00
"wp:attachment" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . PageModel = {
2018-12-16 02:37:56 +01:00
"id" : 7 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?page_id=7"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-page" ,
2017-02-19 05:31:12 +01:00
"status" : "publish" ,
2017-02-15 18:58:14 +01:00
"type" : "page" ,
2018-12-16 02:37:56 +01:00
"link" : "http://example.org/?page_id=7" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Page"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated page content.</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Page</p>\n" ,
2017-02-15 18:58:14 +01:00
"protected" : false
} ,
"author" : 0 ,
"featured_media" : 0 ,
"parent" : 0 ,
"menu_order" : 0 ,
"comment_status" : "closed" ,
"ping_status" : "closed" ,
"template" : "" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . pageRevisions = [
{
2017-05-11 20:31:26 +02:00
"author" : 2 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 9 ,
2017-02-15 18:58:14 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 7 ,
"slug" : "7-autosave-v1" ,
2017-02-15 18:58:14 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=9"
2017-02-15 18:58:14 +01:00
} ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave page content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
} ,
"_links" : {
"parent" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
]
}
} ,
{
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 8 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 7 ,
"slug" : "7-revision-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=8"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Page"
} ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>Updated page content.</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"excerpt" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>REST API Client Fixture: Page</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"_links" : {
"parent" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7"
2017-02-15 18:58:14 +01:00
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . pageRevision = {
2017-05-11 20:31:26 +02:00
"author" : 2 ,
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 8 ,
2017-05-11 20:31:26 +02:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 7 ,
"slug" : "7-revision-v1" ,
2017-05-11 20:31:26 +02:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=8"
2017-05-11 20:31:26 +02:00
} ,
"title" : {
"rendered" : "REST API Client Fixture: Page"
} ,
"content" : {
"rendered" : "<p>Updated page content.</p>\n"
} ,
"excerpt" : {
"rendered" : "<p>REST API Client Fixture: Page</p>\n"
2017-02-15 18:58:14 +01:00
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
mockedApiResponse . pageAutosaves = [
{
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 9 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 7 ,
"slug" : "7-autosave-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=9"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave page content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
} ,
"_links" : {
"parent" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages/7"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
}
]
}
}
] ;
mockedApiResponse . pageAutosave = {
2018-12-16 02:37:56 +01:00
"author" : 2 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"id" : 9 ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
2018-12-16 02:37:56 +01:00
"parent" : 7 ,
"slug" : "7-autosave-v1" ,
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?p=9"
REST API: Introduce Autosaves controller and endpoint.
- Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
- Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
- Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes #45128, #43316.
git-svn-id: https://develop.svn.wordpress.org/trunk@44126 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 23:41:47 +01:00
} ,
"title" : {
"rendered" : ""
} ,
"content" : {
"rendered" : "<p>Autosave page content.</p>\n"
} ,
"excerpt" : {
"rendered" : ""
}
} ;
2017-02-15 18:58:14 +01:00
mockedApiResponse . MediaCollection = [
{
2018-12-16 02:37:56 +01:00
"id" : 10 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?attachment_id=10"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-attachment" ,
2017-02-19 05:31:12 +01:00
"status" : "inherit" ,
2017-02-15 18:58:14 +01:00
"type" : "attachment" ,
2018-12-16 02:37:56 +01:00
"link" : "http://example.org/?attachment_id=10" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Attachment"
} ,
"author" : 0 ,
"comment_status" : "open" ,
"ping_status" : "closed" ,
"template" : "" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
} ,
2017-02-15 18:58:14 +01:00
"description" : {
2017-07-05 11:29:58 +02:00
"rendered" : "<p class=\"attachment\"><!-- <a...><img.../></a> --></p>"
2017-02-15 18:58:14 +01:00
} ,
"caption" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>A sample caption</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"alt_text" : "" ,
"media_type" : "image" ,
2017-02-17 01:12:49 +01:00
"mime_type" : "image/jpeg" ,
2017-02-15 18:58:14 +01:00
"media_details" : { } ,
"post" : null ,
2017-02-17 01:12:49 +01:00
"source_url" : "http://example.org/wp-content/uploads//tmp/canola.jpg" ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/media/10"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/media"
2017-02-15 18:58:14 +01:00
}
] ,
"about" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types/attachment"
2017-02-15 18:58:14 +01:00
}
] ,
"replies" : [
{
2018-12-11 05:00:37 +01:00
"embeddable" : true ,
2018-12-16 02:37:56 +01:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10"
2017-02-15 18:58:14 +01:00
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . MediaModel = {
2018-12-16 02:37:56 +01:00
"id" : 10 ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"guid" : {
2018-12-16 02:37:56 +01:00
"rendered" : "http://example.org/?attachment_id=10"
2017-02-15 18:58:14 +01:00
} ,
"modified" : "2017-02-14T00:00:00" ,
"modified_gmt" : "2017-02-14T00:00:00" ,
"slug" : "restapi-client-fixture-attachment" ,
2017-02-19 05:31:12 +01:00
"status" : "inherit" ,
2017-02-15 18:58:14 +01:00
"type" : "attachment" ,
2018-12-16 02:37:56 +01:00
"link" : "http://example.org/?attachment_id=10" ,
2017-02-15 18:58:14 +01:00
"title" : {
"rendered" : "REST API Client Fixture: Attachment"
} ,
"author" : 0 ,
"comment_status" : "open" ,
"ping_status" : "closed" ,
"template" : "" ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
} ,
2017-02-15 18:58:14 +01:00
"description" : {
2017-07-05 11:29:58 +02:00
"rendered" : "<p class=\"attachment\"><!-- <a...><img.../></a> --></p>"
2017-02-15 18:58:14 +01:00
} ,
"caption" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>A sample caption</p>\n"
2017-02-15 18:58:14 +01:00
} ,
"alt_text" : "" ,
"media_type" : "image" ,
2017-02-17 01:12:49 +01:00
"mime_type" : "image/jpeg" ,
2017-02-15 18:58:14 +01:00
"media_details" : { } ,
"post" : null ,
2017-02-17 01:12:49 +01:00
"source_url" : "http://example.org/wp-content/uploads//tmp/canola.jpg"
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TypesCollection = {
"post" : {
"description" : "" ,
"hierarchical" : false ,
"name" : "Posts" ,
"slug" : "post" ,
"taxonomies" : [
"category" ,
"post_tag"
] ,
"rest_base" : "posts" ,
"_links" : {
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:items" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
} ,
"page" : {
"description" : "" ,
"hierarchical" : true ,
"name" : "Pages" ,
"slug" : "page" ,
"taxonomies" : [ ] ,
"rest_base" : "pages" ,
"_links" : {
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:items" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/pages"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
} ,
"attachment" : {
"description" : "" ,
"hierarchical" : false ,
"name" : "Media" ,
"slug" : "attachment" ,
"taxonomies" : [ ] ,
"rest_base" : "media" ,
"_links" : {
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/types"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:items" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/media"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
2018-12-14 03:34:28 +01:00
} ,
"wp_block" : {
"description" : "" ,
"hierarchical" : false ,
2020-08-23 16:38:40 +02:00
"name" : "Reusable Blocks" ,
2018-12-14 03:34:28 +01:00
"slug" : "wp_block" ,
"taxonomies" : [ ] ,
"rest_base" : "blocks" ,
"_links" : {
"collection" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/types"
}
] ,
"wp:items" : [
{
"href" : "http://example.org/index.php?rest_route=/wp/v2/blocks"
}
] ,
"curies" : [
{
"name" : "wp" ,
"href" : "https://api.w.org/{rel}" ,
"templated" : true
}
]
}
2017-02-15 18:58:14 +01:00
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TypeModel = {
2017-05-11 20:31:26 +02:00
"description" : "" ,
"hierarchical" : false ,
"name" : "Posts" ,
"slug" : "post" ,
"taxonomies" : [
"category" ,
"post_tag"
] ,
"rest_base" : "posts"
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . StatusesCollection = {
"publish" : {
"name" : "Published" ,
"public" : true ,
"queryable" : true ,
"slug" : "publish" ,
2019-09-23 19:39:36 +02:00
"date_floating" : false ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
"future" : {
"name" : "Scheduled" ,
"public" : false ,
"queryable" : false ,
"slug" : "future" ,
2019-09-23 19:39:36 +02:00
"date_floating" : false ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=future"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
"draft" : {
"name" : "Draft" ,
"public" : false ,
"queryable" : false ,
"slug" : "draft" ,
2019-09-23 19:39:36 +02:00
"date_floating" : true ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=draft"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
"pending" : {
"name" : "Pending" ,
"public" : false ,
"queryable" : false ,
"slug" : "pending" ,
2019-09-25 23:37:09 +02:00
"date_floating" : true ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=pending"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
"private" : {
"name" : "Private" ,
"public" : false ,
"queryable" : false ,
"slug" : "private" ,
2019-09-23 19:39:36 +02:00
"date_floating" : false ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=private"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
"trash" : {
"name" : "Trash" ,
"public" : false ,
"queryable" : false ,
"slug" : "trash" ,
2019-09-23 19:39:36 +02:00
"date_floating" : false ,
2017-02-15 18:58:14 +01:00
"_links" : {
"archives" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=trash"
2017-02-15 18:58:14 +01:00
}
]
}
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . StatusModel = {
"name" : "Published" ,
"public" : true ,
"queryable" : true ,
2019-09-23 19:39:36 +02:00
"slug" : "publish" ,
"date_floating" : false
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TaxonomiesCollection = {
"category" : {
"name" : "Categories" ,
"slug" : "category" ,
"description" : "" ,
"types" : [
"post"
] ,
"hierarchical" : true ,
"rest_base" : "categories" ,
"_links" : {
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/taxonomies"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:items" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/categories"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
} ,
"post_tag" : {
"name" : "Tags" ,
"slug" : "post_tag" ,
"description" : "" ,
"types" : [
"post"
] ,
"hierarchical" : false ,
"rest_base" : "tags" ,
"_links" : {
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/taxonomies"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:items" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/tags"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
}
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TaxonomyModel = {
"name" : "Categories" ,
"slug" : "category" ,
"description" : "" ,
"types" : [
"post"
] ,
"hierarchical" : true ,
"rest_base" : "categories"
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . CategoriesCollection = [
{
"id" : 1 ,
"count" : 1 ,
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?cat=1" ,
2017-02-15 18:58:14 +01:00
"name" : "Uncategorized" ,
"slug" : "uncategorized" ,
"taxonomy" : "category" ,
"parent" : 0 ,
2017-10-02 20:39:30 +02:00
"meta" : {
2018-08-28 14:22:48 +02:00
"test_single" : "" ,
"test_multi" : [ ] ,
"meta_key" : "" ,
"test_cat_single" : "" ,
"test_cat_multi" : [ ]
2017-10-02 20:39:30 +02:00
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/categories/1"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/categories"
2017-02-15 18:58:14 +01:00
}
] ,
"about" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/taxonomies/category"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:post_type" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&categories=1"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . CategoryModel = {
"id" : 1 ,
"count" : 1 ,
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?cat=1" ,
2017-02-15 18:58:14 +01:00
"name" : "Uncategorized" ,
"slug" : "uncategorized" ,
"taxonomy" : "category" ,
"parent" : 0 ,
2017-10-02 20:39:30 +02:00
"meta" : {
2018-08-28 14:22:48 +02:00
"test_single" : "" ,
"test_multi" : [ ] ,
"meta_key" : "" ,
"test_cat_single" : "" ,
"test_cat_multi" : [ ]
2017-10-02 20:39:30 +02:00
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TagsCollection = [
{
"id" : 2 ,
"count" : 0 ,
"description" : "REST API Client Fixture: Tag" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?tag=restapi-client-fixture-tag" ,
2017-02-15 18:58:14 +01:00
"name" : "REST API Client Fixture: Tag" ,
"slug" : "restapi-client-fixture-tag" ,
"taxonomy" : "post_tag" ,
2017-10-02 20:39:30 +02:00
"meta" : {
2018-08-28 14:22:48 +02:00
"test_single" : "" ,
"test_multi" : [ ] ,
"meta_key" : "meta_value" ,
"test_tag_meta" : ""
2017-10-02 20:39:30 +02:00
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2017-07-26 05:52:41 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/tags/2"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/tags"
2017-02-15 18:58:14 +01:00
}
] ,
"about" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/taxonomies/post_tag"
2017-02-15 18:58:14 +01:00
}
] ,
"wp:post_type" : [
{
2017-07-26 05:52:41 +02:00
"href" : "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&tags=2"
2017-02-15 18:58:14 +01:00
}
] ,
"curies" : [
{
"name" : "wp" ,
2017-02-17 01:12:49 +01:00
"href" : "https://api.w.org/{rel}" ,
2017-02-15 18:58:14 +01:00
"templated" : true
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . TagModel = {
"id" : 2 ,
"count" : 0 ,
"description" : "REST API Client Fixture: Tag" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?tag=restapi-client-fixture-tag" ,
2017-02-15 18:58:14 +01:00
"name" : "REST API Client Fixture: Tag" ,
"slug" : "restapi-client-fixture-tag" ,
"taxonomy" : "post_tag" ,
2017-10-02 20:39:30 +02:00
"meta" : {
2018-08-28 14:22:48 +02:00
"test_single" : "" ,
"test_multi" : [ ] ,
"meta_key" : "meta_value" ,
"test_tag_meta" : ""
2017-10-02 20:39:30 +02:00
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . UsersCollection = [
{
"id" : 1 ,
"name" : "admin" ,
2020-01-03 14:15:33 +01:00
"url" : "http://example.org" ,
2017-02-15 18:58:14 +01:00
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?author=1" ,
2017-02-15 18:58:14 +01:00
"slug" : "admin" ,
"avatar_urls" : {
2017-02-17 01:12:49 +01:00
"24" : "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g" ,
"48" : "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g" ,
"96" : "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"
2017-02-15 18:58:14 +01:00
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : "meta_value"
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/users/1"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/users"
2017-02-15 18:58:14 +01:00
}
]
}
} ,
{
"id" : 2 ,
"name" : "REST API Client Fixture: User" ,
"url" : "" ,
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?author=2" ,
2017-02-15 18:58:14 +01:00
"slug" : "restapiclientfixtureuser" ,
"avatar_urls" : {
2017-02-17 01:12:49 +01:00
"24" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g" ,
"48" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g" ,
"96" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g"
2017-02-15 18:58:14 +01:00
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2017-07-26 05:52:41 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/users/2"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/users"
2017-02-15 18:58:14 +01:00
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . UserModel = {
"id" : 2 ,
"name" : "REST API Client Fixture: User" ,
"url" : "" ,
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?author=2" ,
2017-02-15 18:58:14 +01:00
"slug" : "restapiclientfixtureuser" ,
"avatar_urls" : {
2017-02-17 01:12:49 +01:00
"24" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g" ,
"48" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g" ,
"96" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g"
2017-02-15 18:58:14 +01:00
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . me = {
"id" : 2 ,
"name" : "REST API Client Fixture: User" ,
"url" : "" ,
"description" : "" ,
2017-02-17 01:12:49 +01:00
"link" : "http://example.org/?author=2" ,
2017-02-15 18:58:14 +01:00
"slug" : "restapiclientfixtureuser" ,
"avatar_urls" : {
2017-02-17 01:12:49 +01:00
"24" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g" ,
"48" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g" ,
"96" : "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g"
2017-02-15 18:58:14 +01:00
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : ""
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . CommentsCollection = [
{
"id" : 2 ,
2018-07-13 06:45:35 +02:00
"post" : 4 ,
2017-02-15 18:58:14 +01:00
"parent" : 0 ,
"author" : 0 ,
"author_name" : "Internet of something or other" ,
2017-02-17 01:12:49 +01:00
"author_url" : "http://lights.example.org/" ,
2017-02-15 18:58:14 +01:00
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"content" : {
2017-02-17 01:12:49 +01:00
"rendered" : "<p>This is a comment</p>\n"
2017-02-15 18:58:14 +01:00
} ,
2018-07-13 06:45:35 +02:00
"link" : "http://example.org/?p=4#comment-2" ,
2017-02-15 18:58:14 +01:00
"status" : "approved" ,
"type" : "comment" ,
"author_avatar_urls" : {
2017-02-17 01:12:49 +01:00
"24" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=24&d=mm&r=g" ,
"48" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=48&d=mm&r=g" ,
"96" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=96&d=mm&r=g"
2017-02-15 18:58:14 +01:00
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : "meta_value"
} ,
2017-02-15 18:58:14 +01:00
"_links" : {
"self" : [
{
2017-07-26 05:52:41 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/comments/2"
2017-02-15 18:58:14 +01:00
}
] ,
"collection" : [
{
2017-07-25 02:49:22 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/comments"
2017-02-15 18:58:14 +01:00
}
] ,
"up" : [
{
"embeddable" : true ,
"post_type" : "post" ,
2018-07-13 06:45:35 +02:00
"href" : "http://example.org/index.php?rest_route=/wp/v2/posts/4"
2017-02-15 18:58:14 +01:00
}
]
}
}
] ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . CommentModel = {
2017-05-11 20:31:26 +02:00
"id" : 2 ,
2018-07-13 06:45:35 +02:00
"post" : 4 ,
2017-05-11 20:31:26 +02:00
"parent" : 0 ,
"author" : 0 ,
"author_name" : "Internet of something or other" ,
"author_url" : "http://lights.example.org/" ,
"date" : "2017-02-14T00:00:00" ,
"date_gmt" : "2017-02-14T00:00:00" ,
"content" : {
"rendered" : "<p>This is a comment</p>\n"
} ,
2018-07-13 06:45:35 +02:00
"link" : "http://example.org/?p=4#comment-2" ,
2017-05-11 20:31:26 +02:00
"status" : "approved" ,
"type" : "comment" ,
"author_avatar_urls" : {
"24" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=24&d=mm&r=g" ,
"48" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=48&d=mm&r=g" ,
"96" : "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=96&d=mm&r=g"
} ,
2017-10-02 20:39:30 +02:00
"meta" : {
"meta_key" : "meta_value"
}
2017-02-15 18:58:14 +01:00
} ;
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 05:22:32 +01:00
2017-02-15 18:58:14 +01:00
mockedApiResponse . settings = {
"title" : "Test Blog" ,
"description" : "Just another WordPress site" ,
2017-02-17 01:12:49 +01:00
"url" : "http://example.org" ,
2017-02-15 18:58:14 +01:00
"email" : "admin@example.org" ,
"timezone" : "" ,
"date_format" : "F j, Y" ,
"time_format" : "g:i a" ,
"start_of_week" : 1 ,
"language" : "en_US" ,
"use_smilies" : true ,
"default_category" : 1 ,
"default_post_format" : "0" ,
"posts_per_page" : 10 ,
"default_ping_status" : "open" ,
2019-01-08 03:50:05 +01:00
"default_comment_status" : "open"
2017-02-15 18:58:14 +01:00
} ;