Make WordPress Core

Ticket #33064: 33064.2.diff

File 33064.2.diff, 3.8 KB (added by valendesigns, 8 years ago)
  • src/wp-includes/class-wp-customize-control.php

    diff --git src/wp-includes/class-wp-customize-control.php src/wp-includes/class-wp-customize-control.php
    index a0abfc5..ae577d1 100644
    class WP_Customize_Control { 
    8484
    8585        /**
    8686         * @access public
     87         * @var bool
     88         */
     89        public $label_hidden = false;
     90
     91        /**
     92         * @access public
    8793         * @var string
    8894         */
    8995        public $description = '';
    class WP_Customize_Control { 
    404410         * @since 3.4.0
    405411         */
    406412        protected function render_content() {
     413                $label_class = 'customize-control-title';
     414                if ( true === $this->label_hidden ) {
     415                        $label_class .= ' screen-reader-text';
     416                }
    407417                switch( $this->type ) {
    408418                        case 'checkbox':
    409419                                ?>
    class WP_Customize_Control { 
    423433                                $name = '_customize-radio-' . $this->id;
    424434
    425435                                if ( ! empty( $this->label ) ) : ?>
    426                                         <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
     436                                        <span class="<?php echo $label_class; ?>"><?php echo esc_html( $this->label ); ?></span>
    427437                                <?php endif;
    428438                                if ( ! empty( $this->description ) ) : ?>
    429439                                        <span class="description customize-control-description"><?php echo $this->description ; ?></span>
    class WP_Customize_Control { 
    445455                                ?>
    446456                                <label>
    447457                                        <?php if ( ! empty( $this->label ) ) : ?>
    448                                                 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
     458                                                <span class="<?php echo $label_class; ?>"><?php echo esc_html( $this->label ); ?></span>
    449459                                        <?php endif;
    450460                                        if ( ! empty( $this->description ) ) : ?>
    451461                                                <span class="description customize-control-description"><?php echo $this->description; ?></span>
    class WP_Customize_Control { 
    464474                                ?>
    465475                                <label>
    466476                                        <?php if ( ! empty( $this->label ) ) : ?>
    467                                                 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
     477                                                <span class="<?php echo $label_class; ?>"><?php echo esc_html( $this->label ); ?></span>
    468478                                        <?php endif;
    469479                                        if ( ! empty( $this->description ) ) : ?>
    470480                                                <span class="description customize-control-description"><?php echo $this->description; ?></span>
    class WP_Customize_Control { 
    477487                                ?>
    478488                                <label>
    479489                                <?php if ( ! empty( $this->label ) ) : ?>
    480                                         <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
     490                                        <span class="<?php echo $label_class; ?>"><?php echo esc_html( $this->label ); ?></span>
    481491                                <?php endif;
    482492                                if ( ! empty( $this->description ) ) : ?>
    483493                                        <span class="description customize-control-description"><?php echo $this->description; ?></span>
    class WP_Customize_Control { 
    504514                                ?>
    505515                                <label>
    506516                                        <?php if ( ! empty( $this->label ) ) : ?>
    507                                                 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
     517                                                <span class="<?php echo $label_class; ?>"><?php echo esc_html( $this->label ); ?></span>
    508518                                        <?php endif;
    509519                                        if ( ! empty( $this->description ) ) : ?>
    510520                                                <span class="description customize-control-description"><?php echo $this->description; ?></span>
  • src/wp-includes/class-wp-customize-nav-menus.php

    diff --git src/wp-includes/class-wp-customize-nav-menus.php src/wp-includes/class-wp-customize-nav-menus.php
    index adccacd..204b51c 100644
    final class WP_Customize_Nav_Menus { 
    566566                ) );
    567567
    568568                $this->manager->add_control( 'new_menu_name', array(
    569                         'label'       => '',
    570                         'section'     => 'add_menu',
    571                         'type'        => 'text',
    572                         'input_attrs' => array(
     569                        'label'        => __( 'New menu name' ),
     570                        'label_hidden' => true,
     571                        'section'      => 'add_menu',
     572                        'type'         => 'text',
     573                        'input_attrs'  => array(
    573574                                'class'       => 'menu-name-field',
    574575                                'placeholder' => __( 'New menu name' ),
    575576                        ),