Customizer: when available, show the `description` when rendering the `dropdown-pages` Control.

Props downstairsdev, MikeHansenMe, _smartik_.
Fixes #31540.


git-svn-id: https://develop.svn.wordpress.org/trunk@35275 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-10-20 03:47:34 +00:00
parent 85af87a19b
commit 9b27952d46
1 changed files with 14 additions and 7 deletions

View File

@ -474,7 +474,16 @@ class WP_Customize_Control {
<?php
break;
case 'dropdown-pages':
$dropdown = wp_dropdown_pages(
?>
<label>
<?php if ( ! empty( $this->label ) ) : ?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php endif;
if ( ! empty( $this->description ) ) : ?>
<span class="description customize-control-description"><?php echo $this->description; ?></span>
<?php endif; ?>
<?php $dropdown = wp_dropdown_pages(
array(
'name' => '_customize-dropdown-pages-' . $this->id,
'echo' => 0,
@ -486,12 +495,10 @@ class WP_Customize_Control {
// Hackily add in the data link parameter.
$dropdown = str_replace( '<select', '<select ' . $this->get_link(), $dropdown );
printf(
'<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>',
$this->label,
$dropdown
);
echo $dropdown;
?>
</label>
<?php
break;
default:
?>