WP_REST_Sidebars_Controller::get_sidebar()protectedWP 5.8.0

Retrieves the registered sidebar with the given id.

{} It's a method of the class: WP_REST_Sidebars_Controller{}

No Hooks.

Return

Array|null. The discovered sidebar, or null if it is not registered.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_sidebar( $id );
$id(string|int) (required)
ID of the sidebar.

Changelog

Since 5.8.0 Introduced.

Code of WP_REST_Sidebars_Controller::get_sidebar() WP 6.0

protected function get_sidebar( $id ) {
	return wp_get_sidebar( $id );
}