WP_REST_Widgets_Controller::check_read_sidebar_permission()
Checks if a sidebar can be read publicly.
Method of the class: WP_REST_Widgets_Controller{}
No Hooks.
Return
true|false
. Whether the sidebar can be read.
Usage
// protected - for code of main (parent) or child class $result = $this->check_read_sidebar_permission( $sidebar_id );
- $sidebar_id(string) (required)
- The sidebar ID.
Changelog
Since 5.9.0 | Introduced. |
WP_REST_Widgets_Controller::check_read_sidebar_permission() WP REST Widgets Controller::check read sidebar permission code WP 6.3
protected function check_read_sidebar_permission( $sidebar_id ) { $sidebar = wp_get_sidebar( $sidebar_id ); return ! empty( $sidebar['show_in_rest'] ); }