Make WordPress Core


Ignore:
Timestamp:
09/07/2025 02:45:32 AM (11 months ago)
Author:
joedolson
Message:

Customizer: Accessible errors when adding new pages.

When setting the home page settings or dynamically adding new pages in the menu manager, the error messages didn't meet accessibility standards.

Add a screen reader announcement, a visible notification, and standardize the error styles.

Props dilipbheda, dlh, celloexpressions, joedolson, jeremiahbratton, shailu25.
Fixes #50696.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r60668 r60715  
    647647                                                <label for="create-input-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'New page title' ); ?></label>
    648648                                                <div class="new-content-item">
    649                                                         <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input" >
     649                                                        <input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input form-required">
    650650                                                        <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
    651651                                                </div>
     652                                                <span id="create-input-<?php echo esc_attr( $this->id ); ?>-error" class="create-item-error error-message" style="display: none;"><?php _e( 'Please enter a page title' ); ?></span>
     653
    652654                                        </div>
    653655                                <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.