Make WordPress Core


Ignore:
Timestamp:
09/13/2015 06:15:42 AM (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.