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.


Parameters

$sidebar_id

(string)(Required)Sidebar ID to check.


Top ↑

Return

(bool) Whether the sidebar is rendered.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	public function is_sidebar_rendered( $sidebar_id ) {
		return ! empty( $this->rendered_sidebars[ $sidebar_id ] );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More