WP_Customize_Widgets::is_panel_active() WordPress Method

The WP_Customize_Widgets::is_panel_active() method is used to check if the widgets panel is currently active in the Customizer. This is useful for determining whether to show or hide certain controls that are only relevant to the widgets panel.

WP_Customize_Widgets::is_panel_active() #

Determines whether the widgets panel is active, based on whether there are sidebars registered.


Description

Top ↑

See also

  • WP_Customize_Panel::$active_callback

Top ↑

Return

(bool) Active.


Top ↑

Source

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

	public function is_panel_active() {
		global $wp_registered_sidebars;
		return ! empty( $wp_registered_sidebars );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.4.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