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-includes/class-wp-customize-control.php

    r57369 r58146  
    636636                        ?>
    637637                    </button>
    638                     <div class="new-content-item">
    639                         <label for="create-input-<?php echo esc_attr( $this->id ); ?>"><span class="screen-reader-text">
    640                             <?php
    641                             /* translators: Hidden accessibility text. */
    642                             _e( 'New page title' );
    643                             ?>
    644                         </span></label>
    645                         <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input" placeholder="<?php esc_attr_e( 'New page title&hellip;' ); ?>">
    646                         <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
     638                    <div class="new-content-item-wrapper">
     639                        <label for="create-input-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'New page title' ); ?></label>
     640                        <div class="new-content-item">
     641                            <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input" >
     642                            <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
     643                        </div>
    647644                    </div>
    648645                <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.