mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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
This commit is contained in:
@@ -4703,6 +4703,216 @@ mockedApiResponse.Schema = {
|
||||
"_links": {
|
||||
"self": "http://example.org/index.php?rest_route=/wp/v2/themes"
|
||||
}
|
||||
},
|
||||
"/wp/v2/plugins": {
|
||||
"namespace": "wp/v2",
|
||||
"methods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"endpoints": [
|
||||
{
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"args": {
|
||||
"context": {
|
||||
"required": false,
|
||||
"default": "view",
|
||||
"enum": [
|
||||
"view",
|
||||
"embed",
|
||||
"edit"
|
||||
],
|
||||
"description": "Scope under which the request is made; determines fields present in response.",
|
||||
"type": "string"
|
||||
},
|
||||
"search": {
|
||||
"required": false,
|
||||
"description": "Limit results to those matching a string.",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"required": false,
|
||||
"description": "Limits results to plugins with the given status.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"inactive",
|
||||
"active"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"methods": [
|
||||
"POST"
|
||||
],
|
||||
"args": {
|
||||
"slug": {
|
||||
"required": true,
|
||||
"description": "WordPress.org plugin directory slug.",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"required": false,
|
||||
"default": "inactive",
|
||||
"enum": [
|
||||
"inactive",
|
||||
"active"
|
||||
],
|
||||
"description": "The plugin activation status.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"_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": {
|
||||
"required": false,
|
||||
"default": "view",
|
||||
"enum": [
|
||||
"view",
|
||||
"embed",
|
||||
"edit"
|
||||
],
|
||||
"description": "Scope under which the request is made; determines fields present in response.",
|
||||
"type": "string"
|
||||
},
|
||||
"plugin": {
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"methods": [
|
||||
"POST",
|
||||
"PUT",
|
||||
"PATCH"
|
||||
],
|
||||
"args": {
|
||||
"context": {
|
||||
"required": false,
|
||||
"default": "view",
|
||||
"enum": [
|
||||
"view",
|
||||
"embed",
|
||||
"edit"
|
||||
],
|
||||
"description": "Scope under which the request is made; determines fields present in response.",
|
||||
"type": "string"
|
||||
},
|
||||
"plugin": {
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"required": false,
|
||||
"enum": [
|
||||
"inactive",
|
||||
"active"
|
||||
],
|
||||
"description": "The plugin activation status.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"methods": [
|
||||
"DELETE"
|
||||
],
|
||||
"args": {
|
||||
"context": {
|
||||
"required": false,
|
||||
"default": "view",
|
||||
"enum": [
|
||||
"view",
|
||||
"embed",
|
||||
"edit"
|
||||
],
|
||||
"description": "Scope under which the request is made; determines fields present in response.",
|
||||
"type": "string"
|
||||
},
|
||||
"plugin": {
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"/wp/v2/block-directory/search": {
|
||||
"namespace": "wp/v2",
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"endpoints": [
|
||||
{
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"args": {
|
||||
"context": {
|
||||
"required": false,
|
||||
"default": "view",
|
||||
"enum": [
|
||||
"view"
|
||||
],
|
||||
"description": "Scope under which the request is made; determines fields present in response.",
|
||||
"type": "string"
|
||||
},
|
||||
"page": {
|
||||
"required": false,
|
||||
"default": 1,
|
||||
"description": "Current page of the collection.",
|
||||
"type": "integer"
|
||||
},
|
||||
"per_page": {
|
||||
"required": false,
|
||||
"default": 10,
|
||||
"description": "Maximum number of items to be returned in result set.",
|
||||
"type": "integer"
|
||||
},
|
||||
"term": {
|
||||
"required": true,
|
||||
"description": "Limit result set to blocks matching the search term.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"_links": {
|
||||
"self": [
|
||||
{
|
||||
"href": "http://example.org/index.php?rest_route=/wp/v2/block-directory/search"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user