Skip to content

Commit

Permalink
fixes #976
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed May 24, 2016
1 parent 69db85e commit 4b2b377
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions includes/sections/class-kirki-sections-default-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ class Kirki_Sections_Default_Section extends WP_Customize_Section {
*/
public $type = 'kirki-default';

/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 2.3.3
*
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$array = parent::json();
$array['description'] = html_entity_decode( $array['description'], ENT_QUOTES, get_bloginfo( 'charset' ) );
return $array;
}

/**
* An Underscore (JS) template for rendering this section.
*
Expand All @@ -38,26 +51,27 @@ protected function render_template() {
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
<h3 class="accordion-section-title" tabindex="0">
{{ data.title }}
<span class="screen-reader-text"><?php echo esc_html( $l10n['open-section'] ); ?></span>
<span class="screen-reader-text">{{ window.kirki.l10n['open-section'] }}</span>
</h3>
<ul class="accordion-section-content">
<li class="customize-section-description-container">
<div class="customize-section-title">
<button class="customize-section-back" tabindex="-1">
<span class="screen-reader-text"><?php echo esc_html( $l10n['back'] ); ?></span>
<span class="screen-reader-text">{{ window.kirki.l10n.back }}</span>
</button>
<h3>
<span class="customize-action">
{{{ data.customizeAction }}}
</span>
{{ data.title }}
<a href="#" class="kirki-reset-section" data-reset-section-id="{{ data.id }}">
<?php echo wp_kses_post( $l10n['reset-with-icon'] ); ?>
{{{ window.kirki.l10n['reset-with-icon'] }}}
</a>
</h3>
</div>
<# if ( data.description ) { #>
<div class="description customize-section-description">
<# console.log( data.description ); #>
{{{ data.description }}}
</div>
<# } #>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Expanded Section.
*/
class Kirki_Sections_Expanded_Section extends WP_Customize_Section {
class Kirki_Sections_Expanded_Section extends Kirki_Sections_Default_Section {

/**
* The section type.
Expand Down
2 changes: 1 addition & 1 deletion includes/sections/class-kirki-sections-hover-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Hover Section.
*/
class Kirki_Sections_Hover_Section extends WP_Customize_Section {
class Kirki_Sections_Hover_Section extends Kirki_Sections_Default_Section {

/**
* The section type.
Expand Down

0 comments on commit 4b2b377

Please sign in to comment.