Make WordPress Core


Ignore:
Timestamp:
10/23/2020 03:03:37 PM (4 years ago)
Author:
helen
Message:

Administration: Better targeting for required form field highlighting.

Previously, any input or select inside of a .form-invalid wrapper would get the red border highlighting, including submit buttons which was not visually correct. This now only applies to form elements with a class of .form-required inside of the .form-invalid wrapper. It also continues to apply the border to elements with both classes (.form-invalid.form-required) as that is how some of the admin markup is structured.

Plugin authors may need to do the same sort of class application seen in this commit, i.e. add .form-required to certain form elements.

Props sabernhardt, dilipbheda, helen.
Fixes #50686.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/nav-menus.php

    r49220 r49283  
    962962                        <div class="major-publishing-actions wp-clearfix">
    963963                            <label class="menu-name-label" for="menu-name"><?php _e( 'Menu Name' ); ?></label>
    964                             <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox" <?php echo $menu_name_val . $menu_name_aria_desc; ?> />
     964                            <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox form-required" required="required" <?php echo $menu_name_val . $menu_name_aria_desc; ?> />
    965965                            <div class="publishing-action">
    966966                                <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
Note: See TracChangeset for help on using the changeset viewer.