WP_Customize_Widgets::is_sidebar_rendered() WordPress Method
The WP_Customize_Widgets::is_sidebar_rendered() method is used to check whether a sidebar is rendered on the frontend of a WordPress site. This is useful for checking whether a sidebar is active before rendering it in the Customizer.
WP_Customize_Widgets::is_sidebar_rendered( string $sidebar_id ) #
Determines if a sidebar is rendered on the page.
Contents
Parameters
- $sidebar_id
(string)(Required)Sidebar ID to check.
Return
(bool) Whether the sidebar is rendered.
Source
File: wp-includes/class-wp-customize-widgets.php
public function is_sidebar_rendered( $sidebar_id ) { return ! empty( $this->rendered_sidebars[ $sidebar_id ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |