Customizer: Add panel/section type as CSS class to the HTML container.

see #28709.
Built from https://develop.svn.wordpress.org/trunk@30714


git-svn-id: http://core.svn.wordpress.org/trunk@30704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-12-02 22:16:23 +00:00
parent c2d9591122
commit 0826f8ede2
7 changed files with 18 additions and 11 deletions

View File

@ -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 {

File diff suppressed because one or more lines are too long

View File

@ -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 {

File diff suppressed because one or more lines are too long

View File

@ -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;
?>
<li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section">
<li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title" tabindex="0">
<?php echo esc_html( $this->title ); ?>
<span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span>

View File

@ -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;
?>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title" tabindex="0">
@ -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

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30713';
$wp_version = '4.1-beta2-30714';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.