diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 6c09277617..c7c241ada7 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -2941,12 +2941,17 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { if ( $tax_include ) { $terms = array(); $include_children = false; + $operator = 'IN'; if ( rest_is_array( $tax_include ) ) { $terms = $tax_include; } elseif ( rest_is_object( $tax_include ) ) { $terms = empty( $tax_include['terms'] ) ? array() : $tax_include['terms']; $include_children = ! empty( $tax_include['include_children'] ); + + if ( isset( $tax_include['operator'] ) && 'AND' === $tax_include['operator'] ) { + $operator = 'AND'; + } } if ( $terms ) { @@ -2955,6 +2960,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { 'field' => 'term_id', 'terms' => $terms, 'include_children' => $include_children, + 'operator' => $operator, ); } } @@ -3048,6 +3054,14 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { ), $limit_schema ); + // 'operator' is supported only for 'include' queries. + $include_schema['oneOf'][1]['properties']['operator'] = array( + 'description' => __( 'Whether items must be assigned all or any of the specified terms.' ), + 'type' => 'string', + 'enum' => array( 'AND', 'OR' ), + 'default' => 'OR', + ); + $exclude_schema = array_merge( array( /* translators: %s: Taxonomy name. */ diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index af9fbdbd06..54e00c1dff 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -1294,6 +1294,47 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertContains( $p2, $found_ids ); } + /** + * @ticket 41287 + */ + public function test_get_items_with_all_categories() { + $taxonomy = get_taxonomy( 'category' ); + $categories = static::factory()->term->create_many( 2, array( 'taxonomy' => $taxonomy->name ) ); + + $p1 = static::factory()->post->create( + array( + 'post_status' => 'publish', + 'post_category' => array( $categories[0] ), + ) + ); + $p2 = static::factory()->post->create( + array( + 'post_status' => 'publish', + 'post_category' => array( $categories[1] ), + ) + ); + $p3 = static::factory()->post->create( + array( + 'post_status' => 'publish', + 'post_category' => $categories, + ) + ); + + $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); + $request->set_param( + $taxonomy->rest_base, + array( + 'terms' => $categories, + 'operator' => 'AND', + ) + ); + $response = rest_get_server()->dispatch( $request ); + $data = $response->get_data(); + + $this->assertCount( 1, $data ); + $this->assertSame( $p3, $data[0]['id'] ); + } + /** * @ticket 44326 */ diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index c8c08861b4..92e0feb6ec 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -368,7 +368,7 @@ mockedApiResponse.Schema = { "required": false }, "orderby": { - "description": "Sort collection by object attribute.", + "description": "Sort collection by post attribute.", "type": "string", "default": "date", "enum": [ @@ -458,6 +458,15 @@ mockedApiResponse.Schema = { "description": "Whether to include child terms in the terms limiting the result set.", "type": "boolean", "default": false + }, + "operator": { + "description": "Whether items must be assigned all or any of the specified terms.", + "type": "string", + "enum": [ + "AND", + "OR" + ], + "default": "OR" } }, "additionalProperties": false @@ -531,6 +540,15 @@ mockedApiResponse.Schema = { "type": "integer" }, "default": [] + }, + "operator": { + "description": "Whether items must be assigned all or any of the specified terms.", + "type": "string", + "enum": [ + "AND", + "OR" + ], + "default": "OR" } }, "additionalProperties": false @@ -585,7 +603,7 @@ mockedApiResponse.Schema = { ], "args": { "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -594,7 +612,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -603,12 +621,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -625,18 +643,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -649,18 +667,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -669,7 +687,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -690,23 +708,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -729,12 +747,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -743,7 +761,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -752,7 +770,7 @@ mockedApiResponse.Schema = { "required": false }, "format": { - "description": "The format for the object.", + "description": "The format for the post.", "type": "string", "enum": [ "standard", @@ -775,17 +793,17 @@ mockedApiResponse.Schema = { "required": false }, "sticky": { - "description": "Whether or not the object should be treated as sticky.", + "description": "Whether or not the post should be treated as sticky.", "type": "boolean", "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false }, "categories": { - "description": "The terms assigned to the object in the category taxonomy.", + "description": "The terms assigned to the post in the category taxonomy.", "type": "array", "items": { "type": "integer" @@ -793,7 +811,7 @@ mockedApiResponse.Schema = { "required": false }, "tags": { - "description": "The terms assigned to the object in the post_tag taxonomy.", + "description": "The terms assigned to the post in the post_tag taxonomy.", "type": "array", "items": { "type": "integer" @@ -823,7 +841,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -853,12 +871,12 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -867,7 +885,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -876,12 +894,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -898,18 +916,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -922,18 +940,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -942,7 +960,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -963,23 +981,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1002,12 +1020,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -1016,7 +1034,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -1025,7 +1043,7 @@ mockedApiResponse.Schema = { "required": false }, "format": { - "description": "The format for the object.", + "description": "The format for the post.", "type": "string", "enum": [ "standard", @@ -1048,17 +1066,17 @@ mockedApiResponse.Schema = { "required": false }, "sticky": { - "description": "Whether or not the object should be treated as sticky.", + "description": "Whether or not the post should be treated as sticky.", "type": "boolean", "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false }, "categories": { - "description": "The terms assigned to the object in the category taxonomy.", + "description": "The terms assigned to the post in the category taxonomy.", "type": "array", "items": { "type": "integer" @@ -1066,7 +1084,7 @@ mockedApiResponse.Schema = { "required": false }, "tags": { - "description": "The terms assigned to the object in the post_tag taxonomy.", + "description": "The terms assigned to the post in the post_tag taxonomy.", "type": "array", "items": { "type": "integer" @@ -1081,7 +1099,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -1107,7 +1125,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, @@ -1206,12 +1224,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -1234,12 +1252,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -1266,7 +1284,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, @@ -1289,12 +1307,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -1303,7 +1321,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -1312,12 +1330,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -1334,18 +1352,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1358,18 +1376,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1378,7 +1396,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -1399,23 +1417,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1438,12 +1456,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -1452,7 +1470,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -1461,7 +1479,7 @@ mockedApiResponse.Schema = { "required": false }, "format": { - "description": "The format for the object.", + "description": "The format for the post.", "type": "string", "enum": [ "standard", @@ -1484,17 +1502,17 @@ mockedApiResponse.Schema = { "required": false }, "sticky": { - "description": "Whether or not the object should be treated as sticky.", + "description": "Whether or not the post should be treated as sticky.", "type": "boolean", "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false }, "categories": { - "description": "The terms assigned to the object in the category taxonomy.", + "description": "The terms assigned to the post in the category taxonomy.", "type": "array", "items": { "type": "integer" @@ -1502,7 +1520,7 @@ mockedApiResponse.Schema = { "required": false }, "tags": { - "description": "The terms assigned to the object in the post_tag taxonomy.", + "description": "The terms assigned to the post in the post_tag taxonomy.", "type": "array", "items": { "type": "integer" @@ -1525,12 +1543,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, "id": { - "description": "The ID for the object.", + "description": "The ID for the autosave.", "type": "integer", "required": false }, @@ -1673,7 +1691,7 @@ mockedApiResponse.Schema = { "required": false }, "orderby": { - "description": "Sort collection by object attribute.", + "description": "Sort collection by post attribute.", "type": "string", "default": "date", "enum": [ @@ -1749,7 +1767,7 @@ mockedApiResponse.Schema = { ], "args": { "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -1758,7 +1776,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -1767,12 +1785,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -1789,23 +1807,23 @@ mockedApiResponse.Schema = { "required": false }, "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the post.", "type": "integer", "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1818,18 +1836,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1838,7 +1856,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -1859,23 +1877,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -1898,12 +1916,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -1912,7 +1930,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -1921,7 +1939,7 @@ mockedApiResponse.Schema = { "required": false }, "menu_order": { - "description": "The order of the object in relation to other object of its type.", + "description": "The order of the post in relation to other posts.", "type": "integer", "required": false }, @@ -1932,7 +1950,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -1959,7 +1977,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -1989,12 +2007,12 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -2003,7 +2021,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -2012,12 +2030,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -2034,23 +2052,23 @@ mockedApiResponse.Schema = { "required": false }, "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the post.", "type": "integer", "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2063,18 +2081,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2083,7 +2101,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -2104,23 +2122,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2143,12 +2161,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -2157,7 +2175,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -2166,7 +2184,7 @@ mockedApiResponse.Schema = { "required": false }, "menu_order": { - "description": "The order of the object in relation to other object of its type.", + "description": "The order of the post in relation to other posts.", "type": "integer", "required": false }, @@ -2177,7 +2195,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -2189,7 +2207,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -2215,7 +2233,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, @@ -2314,12 +2332,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -2342,12 +2360,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -2374,7 +2392,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, @@ -2397,12 +2415,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the post.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -2411,7 +2429,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -2420,12 +2438,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -2442,18 +2460,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2466,18 +2484,18 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2486,7 +2504,7 @@ mockedApiResponse.Schema = { "readonly": true }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -2507,23 +2525,23 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "excerpt": { - "description": "The excerpt for the object.", + "description": "The excerpt for the post.", "type": "object", "properties": { "raw": { - "description": "Excerpt for the object, as it exists in the database.", + "description": "Excerpt for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML excerpt for the object, transformed for display.", + "description": "HTML excerpt for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2546,12 +2564,12 @@ mockedApiResponse.Schema = { "required": false }, "featured_media": { - "description": "The ID of the featured media for the object.", + "description": "The ID of the featured media for the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -2560,7 +2578,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -2569,7 +2587,7 @@ mockedApiResponse.Schema = { "required": false }, "menu_order": { - "description": "The order of the object in relation to other object of its type.", + "description": "The order of the post in relation to other posts.", "type": "integer", "required": false }, @@ -2580,7 +2598,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -2600,12 +2618,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, "id": { - "description": "The ID for the object.", + "description": "The ID for the autosave.", "type": "integer", "required": false }, @@ -2743,7 +2761,7 @@ mockedApiResponse.Schema = { "required": false }, "orderby": { - "description": "Sort collection by object attribute.", + "description": "Sort collection by post attribute.", "type": "string", "default": "date", "enum": [ @@ -2827,7 +2845,7 @@ mockedApiResponse.Schema = { ], "args": { "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -2836,7 +2854,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -2845,12 +2863,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -2862,18 +2880,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -2886,12 +2904,12 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -2900,7 +2918,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -2915,7 +2933,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false }, @@ -2953,14 +2971,14 @@ mockedApiResponse.Schema = { "type": "object", "properties": { "raw": { - "description": "Description for the object, as it exists in the database.", + "description": "Description for the attachment, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML description for the object, transformed for display.", + "description": "HTML description for the attachment, transformed for display.", "type": "string", "context": [ "view", @@ -2999,7 +3017,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -3024,12 +3042,12 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -3038,7 +3056,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -3047,12 +3065,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -3064,18 +3082,18 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML title for the object, transformed for display.", + "description": "HTML title for the post, transformed for display.", "type": "string", "context": [ "view", @@ -3088,12 +3106,12 @@ mockedApiResponse.Schema = { "required": false }, "author": { - "description": "The ID for the author of the object.", + "description": "The ID for the author of the post.", "type": "integer", "required": false }, "comment_status": { - "description": "Whether or not comments are open on the object.", + "description": "Whether or not comments are open on the post.", "type": "string", "enum": [ "open", @@ -3102,7 +3120,7 @@ mockedApiResponse.Schema = { "required": false }, "ping_status": { - "description": "Whether or not the object can be pinged.", + "description": "Whether or not the post can be pinged.", "type": "string", "enum": [ "open", @@ -3117,7 +3135,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false }, @@ -3155,14 +3173,14 @@ mockedApiResponse.Schema = { "type": "object", "properties": { "raw": { - "description": "Description for the object, as it exists in the database.", + "description": "Description for the attachment, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML description for the object, transformed for display.", + "description": "HTML description for the attachment, transformed for display.", "type": "string", "context": [ "view", @@ -3186,7 +3204,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -3212,7 +3230,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the attachment.", "type": "integer", "required": false }, @@ -3467,7 +3485,7 @@ mockedApiResponse.Schema = { "required": false }, "orderby": { - "description": "Sort collection by object attribute.", + "description": "Sort collection by post attribute.", "type": "string", "default": "date", "enum": [ @@ -3524,7 +3542,7 @@ mockedApiResponse.Schema = { ], "args": { "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -3533,7 +3551,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -3542,12 +3560,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -3564,11 +3582,11 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -3579,11 +3597,11 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -3591,7 +3609,7 @@ mockedApiResponse.Schema = { ] }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -3612,7 +3630,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -3639,7 +3657,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -3669,12 +3687,12 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -3683,7 +3701,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -3692,12 +3710,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -3714,11 +3732,11 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -3729,11 +3747,11 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -3741,7 +3759,7 @@ mockedApiResponse.Schema = { ] }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -3762,7 +3780,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -3774,7 +3792,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the post.", "type": "integer", "required": false }, @@ -3800,7 +3818,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, @@ -3899,12 +3917,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -3927,12 +3945,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the revision.", "type": "integer", "required": false }, "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the revision.", "type": "integer", "required": false }, @@ -3959,7 +3977,7 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, @@ -3982,12 +4000,12 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the post was published, in the site's timezone.", "type": [ "string", "null" @@ -3996,7 +4014,7 @@ mockedApiResponse.Schema = { "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the post was published, as GMT.", "type": [ "string", "null" @@ -4005,12 +4023,12 @@ mockedApiResponse.Schema = { "required": false }, "slug": { - "description": "An alphanumeric identifier for the object unique to its type.", + "description": "An alphanumeric identifier for the post unique to its type.", "type": "string", "required": false }, "status": { - "description": "A named status for the object.", + "description": "A named status for the post.", "type": "string", "enum": [ "publish", @@ -4027,11 +4045,11 @@ mockedApiResponse.Schema = { "required": false }, "title": { - "description": "The title for the object.", + "description": "The title for the post.", "type": "object", "properties": { "raw": { - "description": "Title for the object, as it exists in the database.", + "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -4042,11 +4060,11 @@ mockedApiResponse.Schema = { "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the post.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ "view", @@ -4054,7 +4072,7 @@ mockedApiResponse.Schema = { ] }, "block_version": { - "description": "Version of the content block format used by the object.", + "description": "Version of the content block format used by the post.", "type": "integer", "context": [ "edit" @@ -4075,7 +4093,7 @@ mockedApiResponse.Schema = { "required": false }, "template": { - "description": "The theme file to use to display the object.", + "description": "The theme file to use to display the post.", "type": "string", "required": false } @@ -4095,12 +4113,459 @@ mockedApiResponse.Schema = { ], "args": { "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the autosave.", "type": "integer", "required": false }, "id": { - "description": "The ID for the object.", + "description": "The ID for the autosave.", + "type": "integer", + "required": false + }, + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed", + "edit" + ], + "default": "view", + "required": false + } + } + } + ] + }, + "/wp/v2/templates": { + "namespace": "wp/v2", + "methods": [ + "GET", + "POST" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed", + "edit" + ], + "required": false + }, + "wp_id": { + "description": "Limit to the specified post id.", + "type": "integer", + "required": false + } + } + }, + { + "methods": [ + "POST" + ], + "args": { + "slug": { + "description": "Unique slug identifying the template.", + "type": "string", + "minLength": 1, + "pattern": "[a-zA-Z_\\-]+", + "required": true + }, + "theme": { + "description": "Theme identifier for the template.", + "type": "string", + "required": false + }, + "content": { + "default": "", + "description": "Content of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "title": { + "default": "", + "description": "Title of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "description": { + "default": "", + "description": "Description of template.", + "type": "string", + "required": false + }, + "status": { + "default": "publish", + "description": "Status of template.", + "type": "string", + "required": false + } + } + } + ], + "_links": { + "self": [ + { + "href": "http://example.org/index.php?rest_route=/wp/v2/templates" + } + ] + } + }, + "/wp/v2/templates/(?P[\\/\\w-]+)": { + "namespace": "wp/v2", + "methods": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "id": { + "description": "The id of a template", + "type": "string", + "required": false + } + } + }, + { + "methods": [ + "POST", + "PUT", + "PATCH" + ], + "args": { + "slug": { + "description": "Unique slug identifying the template.", + "type": "string", + "minLength": 1, + "pattern": "[a-zA-Z_\\-]+", + "required": false + }, + "theme": { + "description": "Theme identifier for the template.", + "type": "string", + "required": false + }, + "content": { + "description": "Content of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "title": { + "description": "Title of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "description": { + "description": "Description of template.", + "type": "string", + "required": false + }, + "status": { + "description": "Status of template.", + "type": "string", + "required": false + } + } + }, + { + "methods": [ + "DELETE" + ], + "args": { + "force": { + "type": "boolean", + "default": false, + "description": "Whether to bypass Trash and force deletion.", + "required": false + } + } + } + ] + }, + "/wp/v2/templates/(?P[\\d]+)/revisions": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "parent": { + "description": "The ID for the parent of the revision.", + "type": "integer", + "required": false + }, + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed", + "edit" + ], + "default": "view", + "required": false + }, + "page": { + "description": "Current page of the collection.", + "type": "integer", + "default": 1, + "minimum": 1, + "required": false + }, + "per_page": { + "description": "Maximum number of items to be returned in result set.", + "type": "integer", + "minimum": 1, + "maximum": 100, + "required": false + }, + "search": { + "description": "Limit results to those matching a string.", + "type": "string", + "required": false + }, + "exclude": { + "description": "Ensure result set excludes specific IDs.", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "required": false + }, + "include": { + "description": "Limit result set to specific IDs.", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "required": false + }, + "offset": { + "description": "Offset the result set by a specific number of items.", + "type": "integer", + "required": false + }, + "order": { + "description": "Order sort attribute ascending or descending.", + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "required": false + }, + "orderby": { + "description": "Sort collection by object attribute.", + "type": "string", + "default": "date", + "enum": [ + "date", + "id", + "include", + "relevance", + "slug", + "include_slugs", + "title" + ], + "required": false + } + } + } + ] + }, + "/wp/v2/templates/(?P[\\d]+)/revisions/(?P[\\d]+)": { + "namespace": "wp/v2", + "methods": [ + "GET", + "DELETE" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "parent": { + "description": "The ID for the parent of the revision.", + "type": "integer", + "required": false + }, + "id": { + "description": "Unique identifier for the revision.", + "type": "integer", + "required": false + }, + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed", + "edit" + ], + "default": "view", + "required": false + } + } + }, + { + "methods": [ + "DELETE" + ], + "args": { + "parent": { + "description": "The ID for the parent of the revision.", + "type": "integer", + "required": false + }, + "id": { + "description": "Unique identifier for the revision.", + "type": "integer", + "required": false + }, + "force": { + "type": "boolean", + "default": false, + "description": "Required to be true, as revisions do not support trashing.", + "required": false + } + } + } + ] + }, + "/wp/v2/templates/(?P[\\d]+)/autosaves": { + "namespace": "wp/v2", + "methods": [ + "GET", + "POST" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "parent": { + "description": "The ID for the parent of the autosave.", + "type": "integer", + "required": false + }, + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed", + "edit" + ], + "default": "view", + "required": false + } + } + }, + { + "methods": [ + "POST" + ], + "args": { + "parent": { + "description": "The ID for the parent of the autosave.", + "type": "integer", + "required": false + }, + "slug": { + "description": "Unique slug identifying the template.", + "type": "string", + "minLength": 1, + "pattern": "[a-zA-Z_\\-]+", + "required": false + }, + "theme": { + "description": "Theme identifier for the template.", + "type": "string", + "required": false + }, + "content": { + "description": "Content of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "title": { + "description": "Title of template.", + "type": [ + "object", + "string" + ], + "required": false + }, + "description": { + "description": "Description of template.", + "type": "string", + "required": false + }, + "status": { + "description": "Status of template.", + "type": "string", + "required": false + } + } + } + ] + }, + "/wp/v2/templates/(?P[\\d]+)/autosaves/(?P[\\d]+)": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "parent": { + "description": "The ID for the parent of the autosave.", + "type": "integer", + "required": false + }, + "id": { + "description": "The ID for the autosave.", "type": "integer", "required": false }, @@ -4862,7 +5327,7 @@ mockedApiResponse.Schema = { }, "orderby": { "default": "name", - "description": "Sort collection by object attribute.", + "description": "Sort collection by user attribute.", "enum": [ "id", "include", @@ -5533,7 +5998,7 @@ mockedApiResponse.Schema = { "required": false }, "orderby": { - "description": "Sort collection by object attribute.", + "description": "Sort collection by comment attribute.", "type": "string", "default": "date_gmt", "enum": [ @@ -5604,46 +6069,46 @@ mockedApiResponse.Schema = { "required": false }, "author_email": { - "description": "Email address for the object author.", + "description": "Email address for the comment author.", "type": "string", "format": "email", "required": false }, "author_ip": { - "description": "IP address for the object author.", + "description": "IP address for the comment author.", "type": "string", "format": "ip", "required": false }, "author_name": { - "description": "Display name for the object author.", + "description": "Display name for the comment author.", "type": "string", "required": false }, "author_url": { - "description": "URL for the object author.", + "description": "URL for the comment author.", "type": "string", "format": "uri", "required": false }, "author_user_agent": { - "description": "User agent for the object author.", + "description": "User agent for the comment author.", "type": "string", "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the comment.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the comment, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the comment, transformed for display.", "type": "string", "context": [ "view", @@ -5656,20 +6121,20 @@ mockedApiResponse.Schema = { "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the comment was published, in the site's timezone.", "type": "string", "format": "date-time", "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the comment was published, as GMT.", "type": "string", "format": "date-time", "required": false }, "parent": { "default": 0, - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the comment.", "type": "integer", "required": false }, @@ -5680,7 +6145,7 @@ mockedApiResponse.Schema = { "required": false }, "status": { - "description": "State of the object.", + "description": "State of the comment.", "type": "string", "required": false }, @@ -5713,7 +6178,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the comment.", "type": "integer", "required": false }, @@ -5743,7 +6208,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the comment.", "type": "integer", "required": false }, @@ -5753,46 +6218,46 @@ mockedApiResponse.Schema = { "required": false }, "author_email": { - "description": "Email address for the object author.", + "description": "Email address for the comment author.", "type": "string", "format": "email", "required": false }, "author_ip": { - "description": "IP address for the object author.", + "description": "IP address for the comment author.", "type": "string", "format": "ip", "required": false }, "author_name": { - "description": "Display name for the object author.", + "description": "Display name for the comment author.", "type": "string", "required": false }, "author_url": { - "description": "URL for the object author.", + "description": "URL for the comment author.", "type": "string", "format": "uri", "required": false }, "author_user_agent": { - "description": "User agent for the object author.", + "description": "User agent for the comment author.", "type": "string", "required": false }, "content": { - "description": "The content for the object.", + "description": "The content for the comment.", "type": "object", "properties": { "raw": { - "description": "Content for the object, as it exists in the database.", + "description": "Content for the comment, as it exists in the database.", "type": "string", "context": [ "edit" ] }, "rendered": { - "description": "HTML content for the object, transformed for display.", + "description": "HTML content for the comment, transformed for display.", "type": "string", "context": [ "view", @@ -5805,19 +6270,19 @@ mockedApiResponse.Schema = { "required": false }, "date": { - "description": "The date the object was published, in the site's timezone.", + "description": "The date the comment was published, in the site's timezone.", "type": "string", "format": "date-time", "required": false }, "date_gmt": { - "description": "The date the object was published, as GMT.", + "description": "The date the comment was published, as GMT.", "type": "string", "format": "date-time", "required": false }, "parent": { - "description": "The ID for the parent of the object.", + "description": "The ID for the parent of the comment.", "type": "integer", "required": false }, @@ -5827,7 +6292,7 @@ mockedApiResponse.Schema = { "required": false }, "status": { - "description": "State of the object.", + "description": "State of the comment.", "type": "string", "required": false }, @@ -5845,7 +6310,7 @@ mockedApiResponse.Schema = { ], "args": { "id": { - "description": "Unique identifier for the object.", + "description": "Unique identifier for the comment.", "type": "integer", "required": false }, @@ -6855,6 +7320,56 @@ mockedApiResponse.Schema = { ] } }, + "/wp/v2/pattern-directory/patterns": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "context": { + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string", + "enum": [ + "view", + "embed" + ], + "default": "view", + "required": false + }, + "search": { + "description": "Limit results to those matching a string.", + "type": "string", + "minLength": 1, + "required": false + }, + "category": { + "description": "Limit results to those matching a category ID.", + "type": "integer", + "minimum": 1, + "required": false + }, + "keyword": { + "description": "Limit results to those matching a keyword ID.", + "type": "integer", + "minimum": 1, + "required": false + } + } + } + ], + "_links": { + "self": [ + { + "href": "http://example.org/index.php?rest_route=/wp/v2/pattern-directory/patterns" + } + ] + } + }, "/wp-site-health/v1": { "namespace": "wp-site-health/v1", "methods": [ @@ -7907,6 +8422,33 @@ mockedApiResponse.TypesCollection = { } ] } + }, + "wp_template": { + "description": "Templates to include in your theme.", + "hierarchical": false, + "name": "Templates", + "slug": "wp_template", + "taxonomies": [], + "rest_base": "templates", + "_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/templates" + } + ], + "curies": [ + { + "name": "wp", + "href": "https://api.w.org/{rel}", + "templated": true + } + ] + } } };