Make WordPress Core


Ignore:
Timestamp:
09/07/2025 02:45:32 AM (8 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-nav-menus.php

    r60681 r60715  
    12381238                            <label for="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label>
    12391239                            <div class="new-content-item">
    1240                                 <input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input">
     1240                                <input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input form-required">
    12411241                                <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
    12421242                            </div>
     1243                            <span id="create-input-<?php echo esc_attr( $available_item_type['object'] ); ?>-error" class="create-item-error error-message" style="display: none;"><?php _e( 'Please enter an item title' ); ?></span>
     1244
    12431245                        </div>
    12441246                    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.