WP_REST_Sidebars_Controller::get_sidebar()
Retrieves the registered sidebar with the given id.
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. |
WP_REST_Sidebars_Controller::get_sidebar() WP REST Sidebars Controller::get sidebar code WP 6.6.2
protected function get_sidebar( $id ) { return wp_get_sidebar( $id ); }