`/wp/v2/sidebars`

Namespace: wp/v2
Route: /wp/v2/sidebars

Routes

  • Collection: /wp/v2/sidebars
  • Single: /wp/v2/sidebars/{id}

HTTP Methods

Collection methods: GET

Single methods: GET, POST, PUT, PATCH

Request Parameters

Collection GET

ParameterTypeRequiredDefaultDescription
contextstringfalseviewScope under which the request is made; determines fields present in response.

Single GET

ParameterTypeRequiredDefaultDescription
idstringfalseThe id of a registered sidebar
contextstringfalseviewScope under which the request is made; determines fields present in response.

Single POST, PUT, PATCH

ParameterTypeRequiredDefaultDescription
widgetsarrayfalseNested widgets.

Response Schema (Item)

FieldTypeDescription
idstringID of sidebar. (read-only)
namestringUnique name identifying the sidebar. (read-only)
descriptionstringDescription of sidebar. (read-only)
classstringExtra CSS class to assign to the sidebar in the Widgets interface. (read-only)
before_widgetstringHTML content to prepend to each widget’s HTML output when assigned to this sidebar. Default is an opening list item element. (read-only)
after_widgetstringHTML content to append to each widget’s HTML output when assigned to this sidebar. Default is a closing list item element. (read-only)
before_titlestringHTML content to prepend to the sidebar title when displayed. Default is an opening h2 element. (read-only)
after_titlestringHTML content to append to the sidebar title when displayed. Default is a closing h2 element. (read-only)
statusstringStatus of sidebar. (read-only)
widgetsarrayNested widgets.

Authentication

  • Read/Write: edit_theme_options.

Example Requests

bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/sidebars"
bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/sidebars/sidebar-1"

Example Response (trimmed)

json
{
  "id": 1,
  "_links": {
    "self": [{ "href": "/wp/v2/sidebars/1" }]
  }
}