123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- /* jshint -W109 */
- /* jshint unused:false */
- var jsWidgetsEndpointSchema =
- {
- "namespace": "js-widgets\/v1",
- "routes": {
- "\/js-widgets\/v1": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "namespace": { "required": false, "default": "js-widgets\/v1" },
- "context": { "required": false, "default": "view" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1" }
- },
- "\/js-widgets\/v1\/widgets\/pages": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "sortby": { "required": false, "default": "menu_order", "enum": ["post_title", "menu_order", "ID"], "description": "How to sort the pages.", "type": "string" },
- "exclude": { "required": false, "default": [], "description": "Page IDs to exclude.", "type": ["array", "string"] }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/pages" }
- },
- "\/js-widgets\/v1\/widgets\/pages\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "sortby": { "required": false, "default": "menu_order", "enum": ["post_title", "menu_order", "ID"], "description": "How to sort the pages.", "type": "string" },
- "exclude": { "required": false, "default": [], "description": "Page IDs to exclude.", "type": ["array", "string"] }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "sortby": { "required": false, "enum": ["post_title", "menu_order", "ID"], "description": "How to sort the pages.", "type": "string" },
- "exclude": { "required": false, "description": "Page IDs to exclude.", "type": ["array", "string"] }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/calendar": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/calendar" }
- },
- "\/js-widgets\/v1\/widgets\/calendar\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/archives": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "default": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "default": false, "description": "Show post counts", "type": "boolean" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/archives" }
- },
- "\/js-widgets\/v1\/widgets\/archives\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "default": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "default": false, "description": "Show post counts", "type": "boolean" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "description": "Show post counts", "type": "boolean" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/meta": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/meta" }
- },
- "\/js-widgets\/v1\/widgets\/meta\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/search": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/search" }
- },
- "\/js-widgets\/v1\/widgets\/search\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/text": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "text": { "required": false, "description": "The content for the widget.", "type": ["string", "object"] },
- "filter": { "required": false, "default": false, "description": "Whether paragraphs will be added for double line breaks (wpautop).", "type": "boolean" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/text" }
- },
- "\/js-widgets\/v1\/widgets\/text\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "text": { "required": false, "description": "The content for the widget.", "type": ["string", "object"] },
- "filter": { "required": false, "default": false, "description": "Whether paragraphs will be added for double line breaks (wpautop).", "type": "boolean" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "text": { "required": false, "description": "The content for the widget.", "type": ["string", "object"] },
- "filter": { "required": false, "description": "Whether paragraphs will be added for double line breaks (wpautop).", "type": "boolean" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/categories": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "default": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "default": false, "description": "Show post counts", "type": "boolean" },
- "hierarchical": { "required": false, "default": false, "description": "Show hierarchy", "type": "boolean" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/categories" }
- },
- "\/js-widgets\/v1\/widgets\/categories\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "default": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "default": false, "description": "Show post counts", "type": "boolean" },
- "hierarchical": { "required": false, "default": false, "description": "Show hierarchy", "type": "boolean" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "dropdown": { "required": false, "description": "Display as dropdown", "type": "boolean" },
- "count": { "required": false, "description": "Show post counts", "type": "boolean" },
- "hierarchical": { "required": false, "description": "Show hierarchy", "type": "boolean" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/recent-posts": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "default": 5, "description": "The number of posts to display.", "type": "integer" },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/recent-posts" }
- },
- "\/js-widgets\/v1\/widgets\/recent-posts\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "default": 5, "description": "The number of posts to display.", "type": "integer" },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "description": "The number of posts to display.", "type": "integer" },
- "show_date": { "required": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/recent-comments": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "default": 5, "description": "The number of comments to display.", "type": "integer" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/recent-comments" }
- },
- "\/js-widgets\/v1\/widgets\/recent-comments\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "default": 5, "description": "The number of comments to display.", "type": "integer" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "number": { "required": false, "description": "The number of comments to display.", "type": "integer" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/rss": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "url": { "required": false, "default": "", "description": "The RSS feed URL.", "type": "string" },
- "items": { "required": false, "default": 10, "description": "The number of RSS items to display.", "type": "integer" },
- "show_summary": { "required": false, "default": false, "description": "Whether the summary should be shown.", "type": "boolean" },
- "show_author": { "required": false, "default": false, "description": "Whether the author should be shown.", "type": "boolean" },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/rss" }
- },
- "\/js-widgets\/v1\/widgets\/rss\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "url": { "required": false, "default": "", "description": "The RSS feed URL.", "type": "string" },
- "items": { "required": false, "default": 10, "description": "The number of RSS items to display.", "type": "integer" },
- "show_summary": { "required": false, "default": false, "description": "Whether the summary should be shown.", "type": "boolean" },
- "show_author": { "required": false, "default": false, "description": "Whether the author should be shown.", "type": "boolean" },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "url": { "required": false, "description": "The RSS feed URL.", "type": "string" },
- "items": { "required": false, "description": "The number of RSS items to display.", "type": "integer" },
- "show_summary": { "required": false, "description": "Whether the summary should be shown.", "type": "boolean" },
- "show_author": { "required": false, "description": "Whether the author should be shown.", "type": "boolean" },
- "show_date": { "required": false, "description": "Whether the date should be shown.", "type": "boolean" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/tag_cloud": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "taxonomy": { "required": false, "default": "post_tag", "enum": ["category", "post_tag"], "description": "Taxonomy", "type": "string" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/tag_cloud" }
- },
- "\/js-widgets\/v1\/widgets\/tag_cloud\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "taxonomy": { "required": false, "default": "post_tag", "enum": ["category", "post_tag"], "description": "Taxonomy", "type": "string" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "taxonomy": { "required": false, "enum": ["category", "post_tag"], "description": "Taxonomy", "type": "string" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/nav_menu": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "nav_menu": { "required": false, "default": 0, "description": "Selected nav menu", "type": "integer" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/nav_menu" }
- },
- "\/js-widgets\/v1\/widgets\/nav_menu\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "nav_menu": { "required": false, "default": 0, "description": "Selected nav menu", "type": "integer" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "nav_menu": { "required": false, "description": "Selected nav menu", "type": "integer" }
- }
- }]
- },
- "\/js-widgets\/v1\/widgets\/post-collection": {
- "namespace": "js-widgets\/v1",
- "methods": ["GET", "POST"],
- "endpoints": [{
- "methods": ["GET"],
- "args": {
- "context": { "required": false, "enum": ["view", "embed", "edit"], "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }
- }
- }, {
- "methods": ["POST"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" },
- "show_featured_image": { "required": false, "default": false, "description": "Whether the featured image is shown.", "type": "boolean" },
- "show_author": { "required": false, "default": false, "description": "Whether the author is shown.", "type": "boolean" },
- "posts": { "required": false, "default": [], "description": "The IDs for the collected posts.", "type": "array" }
- }
- }],
- "_links": { "self": "http:\/\/newtest.localhost\/wp-json\/js-widgets\/v1\/widgets\/post-collection" }
- },
- "\/js-widgets\/v1\/widgets\/post-collection\/(?P<widget_number>\\d+)": {
- "namespace": "js-widgets\/v1",
- "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" }
- }
- }, {
- "methods": ["POST", "PUT", "PATCH"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "show_date": { "required": false, "default": false, "description": "Whether the date should be shown.", "type": "boolean" },
- "show_featured_image": { "required": false, "default": false, "description": "Whether the featured image is shown.", "type": "boolean" },
- "show_author": { "required": false, "default": false, "description": "Whether the author is shown.", "type": "boolean" },
- "posts": { "required": false, "default": [], "description": "The IDs for the collected posts.", "type": "array" }
- }
- }, {
- "methods": ["DELETE"],
- "args": {
- "title": { "required": false, "description": "The title for the widget.", "type": ["string", "object"] },
- "show_date": { "required": false, "description": "Whether the date should be shown.", "type": "boolean" },
- "show_featured_image": { "required": false, "description": "Whether the featured image is shown.", "type": "boolean" },
- "show_author": { "required": false, "description": "Whether the author is shown.", "type": "boolean" },
- "posts": { "required": false, "description": "The IDs for the collected posts.", "type": "array" }
- }
- }]
- }
- },
- "_links": {
- "up": [
- { "href": "http:\/\/newtest.localhost\/wp-json\/" }
- ]
- }
- };
|