From 104b31ae54d8fe3ca63b473b813a200a07b5accc Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 2 Dec 2014 22:15:33 +0000 Subject: [PATCH] Customizer: Add panel/section type as CSS class to the HTML container. see #28709. git-svn-id: https://develop.svn.wordpress.org/trunk@30714 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/customize-widgets.css | 4 ++-- src/wp-includes/class-wp-customize-panel.php | 7 +++++-- src/wp-includes/class-wp-customize-section.php | 8 ++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/css/customize-widgets.css b/src/wp-admin/css/customize-widgets.css index f025f79f33..20a8a6987c 100644 --- a/src/wp-admin/css/customize-widgets.css +++ b/src/wp-admin/css/customize-widgets.css @@ -7,11 +7,11 @@ * preview loads and we know whether the sidebars are used in the template. */ -.control-section[id^="accordion-section-sidebar-widgets-"], +.control-section.control-section-sidebar, .customize-control-sidebar_widgets label, .customize-control-sidebar_widgets .hide-if-js { /* The link in .customize-control-sidebar_widgets .hide-if-js will fail if it ever gets used. */ - display:none; + display: none; } .customize-control-widget_form .widget-top { diff --git a/src/wp-includes/class-wp-customize-panel.php b/src/wp-includes/class-wp-customize-panel.php index 2fd3937ce4..f5da18e3d7 100644 --- a/src/wp-includes/class-wp-customize-panel.php +++ b/src/wp-includes/class-wp-customize-panel.php @@ -103,11 +103,13 @@ class WP_Customize_Panel { public $sections; /** + * Type of this panel. + * * @since 4.1.0 * @access public * @var string */ - public $type; + public $type = 'default'; /** * Active callback. @@ -285,8 +287,9 @@ class WP_Customize_Panel { * @access protected */ protected function render() { + $classes = 'accordion-section control-section control-panel control-panel-' . $this->type; ?> -
  • +
  • title ); ?> diff --git a/src/wp-includes/class-wp-customize-section.php b/src/wp-includes/class-wp-customize-section.php index 37e7351890..b033203e7f 100644 --- a/src/wp-includes/class-wp-customize-section.php +++ b/src/wp-includes/class-wp-customize-section.php @@ -112,11 +112,13 @@ class WP_Customize_Section { public $controls; /** + * Type of this section. + * * @since 4.1.0 * @access public * @var string */ - public $type; + public $type = 'default'; /** * Active callback. @@ -292,7 +294,7 @@ class WP_Customize_Section { * @since 3.4.0 */ protected function render() { - $classes = 'control-section accordion-section'; + $classes = 'accordion-section control-section control-section-' . $this->type; ?>
  • @@ -324,6 +326,8 @@ class WP_Customize_Section { class WP_Customize_Sidebar_Section extends WP_Customize_Section { /** + * Type of this section. + * * @since 4.1.0 * @access public * @var string