WP_Customize_Widgets::is_panel_active()publicWP 4.4.0

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

Метод класса: WP_Customize_Widgets{}

Хуков нет.

Возвращает

true|false. Active.

Использование

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->is_panel_active();

Заметки

  • Смотрите: WP_Customize_Panel::$active_callback
  • Global. Массив. $wp_registered_sidebars

Список изменений

С версии 4.4.0 Введена.

Код WP_Customize_Widgets::is_panel_active() WP 6.5.2

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