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
This commit is contained in:
parent
c0b15e6b6d
commit
104b31ae54
@ -7,7 +7,7 @@
|
||||
* 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. */
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user