On this page
WP_REST_Sidebars_Controller::get_sidebar( string|int $id ): array|null
Retrieves the registered sidebar with the given id.
Parameters
$idstring|int Required-
ID of the sidebar.
Return
array|null The discovered sidebar, or null if it is not registered.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php. View all references
protected function get_sidebar( $id ) {
return wp_get_sidebar( $id );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_sidebar() wp-includes/widgets.php | Retrieves the registered sidebar with the given ID. |
Used By
| Used By | Description |
|---|---|
| WP_REST_Sidebars_Controller::get_items_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Checks if a given request has access to get sidebars. |
| WP_REST_Sidebars_Controller::get_items() wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Retrieves the list of sidebars (active or inactive). |
| WP_REST_Sidebars_Controller::get_item_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Checks if a given request has access to get a single sidebar. |
| WP_REST_Sidebars_Controller::get_item() wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Retrieves one sidebar from the collection. |
| WP_REST_Sidebars_Controller::update_item() wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Updates a sidebar. |
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_sidebars_controller/get_sidebar