Make WordPress Core


Ignore:
Timestamp:
05/14/2024 04:47:03 PM (2 months ago)
Author:
joedolson
Message:

Administration: A11y: Replace placeholders with visible labels.

Add visible labels to inputs that are using placeholder attributes as a substitute for visible labeling.

Labels added or made visible on the customizer theme search, customizer widget search, customizer menu item search, customizer new page UI, the search plugins screens, the media search screens, and the classic editor link inserter.

Props afercia, joedolson, rcreators, sabernhardt.
See #40331.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r58073 r58146  
    321321    <form class="search-form search-plugins" method="get">
    322322        <input type="hidden" name="tab" value="search" />
     323        <label for="search-plugins"><?php _e( 'Search Plugins' ); ?></label>
     324        <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" />
    323325        <label class="screen-reader-text" for="typeselector">
    324326            <?php
     
    332334            <option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option>
    333335        </select>
    334         <label class="screen-reader-text" for="search-plugins">
    335             <?php
    336             /* translators: Hidden accessibility text. */
    337             _e( 'Search Plugins' );
    338             ?>
    339         </label>
    340         <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" />
    341336        <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>
    342337    </form>
Note: See TracChangeset for help on using the changeset viewer.