Make WordPress Core

Changeset 34093 for trunk


Ignore:
Timestamp:
09/13/2015 06:15:42 AM (9 years ago)
Author:
westonruter
Message:

Customize: Remove redundant aria-label attributes.

Adds an $options array argument to WP_Screen::render_screen_options() to allow the div#screen-options-wrap element to be omitted when wrap value is false.

Props afercia, westonruter.
Fixes #33182.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r33857 r34093  
    146146        <div class="wp-full-overlay-sidebar-content" tabindex="-1">
    147147            <div id="customize-info" class="accordion-section customize-info">
    148                 <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>">
     148                <div class="accordion-section-title">
    149149                    <span class="preview-notice"><?php
    150150                        echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
  • trunk/src/wp-admin/includes/screen.php

    r33985 r34093  
    11001100     * @since 3.3.0
    11011101     *
     1102     * @param array $options {
     1103     *     @type bool $wrap  Whether the screen-options-wrap div will be included. Defaults to true.
     1104     * }
    11021105     * @global array $wp_meta_boxes
    11031106     */
    1104     public function render_screen_options() {
     1107    public function render_screen_options( $options = array() ) {
    11051108        global $wp_meta_boxes;
     1109        $options = wp_parse_args( $options, array(
     1110            'wrap' => true,
     1111        ) );
    11061112
    11071113        $columns = get_column_headers( $this );
     
    11091115
    11101116        ?>
    1111         <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
     1117        <?php if ( $options['wrap'] ) : ?>
     1118            <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
     1119        <?php endif; ?>
    11121120        <form id="adv-settings" method="post">
    11131121        <?php if ( isset( $wp_meta_boxes[ $this->id ] ) || $this->get_option( 'per_page' ) || ( $columns && empty( $columns['_title'] ) ) ) : ?>
     
    11721180        <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
    11731181        </form>
    1174         </div>
    1175         <?php
     1182        <?php if ( $options['wrap'] ) : ?>
     1183            </div>
     1184        <?php endif;
    11761185    }
    11771186
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r33505 r34093  
    417417        // Display screen options.
    418418        $screen = WP_Screen::get( 'nav-menus.php' );
    419         $screen->render_screen_options();
     419        $screen->render_screen_options( array( 'wrap' => false ) );
    420420    }
    421421
     
    476476            <div class="description customize-panel-description">{{{ data.description }}}</div>
    477477            <# } #>
    478             <?php $this->render_screen_options(); ?>
     478            <div id="screen-options-wrap">
     479                <?php $this->render_screen_options(); ?>
     480            </div>
    479481        </li>
    480482    <?php
Note: See TracChangeset for help on using the changeset viewer.