Make WordPress Core

Changeset 62712


Ignore:
Timestamp:
07/13/2026 02:59:41 PM (4 months ago)
Author:
afercia
Message:

Upgrade/Install: Improve accessibility of the setup-config and install pages.

  • Makes the language chooser label always visible.
  • Adds missing lang attribute to the HTML element.
  • Makes sure get_language_attributes() returns correct values on the setup-config page.

Props sabernhardt, joedolson, shailesh7714, afercia.
Fixes #65454.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/install.css

    r62230 r62712  
    323323}
    324324
     325.language-chooser [for="language"] {
     326        display: inline-block;
     327        margin-bottom: 10px;
     328        font-size: 14px;
     329        font-weight: 600;
     330}
     331
    325332.language-chooser select {
    326333        padding: 8px;
  • trunk/src/wp-admin/includes/translation-install.php

    r59009 r62712  
    206206        $installed_languages = get_available_languages();
    207207
    208         echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n";
     208        echo "<label for='language'>Select a default language</label>\n";
    209209        echo "<select size='14' name='language' id='language'>\n";
    210210        echo '<option value="" lang="en" selected="selected" data-continue="Continue" data-installed="1">English (United States)</option>';
  • trunk/src/wp-admin/install.php

    r61681 r62712  
    1111        ?>
    1212<!DOCTYPE html>
    13 <html>
     13<html lang="en-US">
    1414<head>
    1515        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  • trunk/src/wp-admin/setup-config.php

    r61681 r62712  
    9696        $body_classes[] = 'wp-core-ui';
    9797        $body_classes[] = 'admin-color-modern';
    98         $dir_attr       = '';
     98
    9999        if ( is_rtl() ) {
    100100                $body_classes[] = 'rtl';
    101                 $dir_attr       = ' dir="rtl"';
    102101        }
    103102
    … …  
    105104        ?>
    106105<!DOCTYPE html>
    107 <html<?php echo $dir_attr; ?>>
     106<html <?php language_attributes(); ?>>
    108107<head>
    109108        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    … …  
    135134                        if ( $languages ) {
    136135                                setup_config_display_header( 'language-chooser' );
    137                                 echo '<h1 class="screen-reader-text">Select a default language</h1>';
     136                                echo '<h1 class="screen-reader-text">Welcome to WordPress</h1>';
    138137                                echo '<form id="setup" method="post" action="?step=0">';
    139138                                wp_install_language_form( $languages );
  • trunk/src/wp-includes/general-template.php

    r62502 r62712  
    45474547        }
    45484548
    4549         $lang = get_bloginfo( 'language' );
     4549        $lang      = get_bloginfo( 'language' );
     4550        $html_type = get_option( 'html_type' );
     4551
    45504552        if ( $lang ) {
    4551                 if ( 'text/html' === get_option( 'html_type' ) || 'html' === $doctype ) {
     4553                if ( 'text/html' === $html_type || 'html' === $doctype ) {
    45524554                        $attributes[] = 'lang="' . esc_attr( $lang ) . '"';
    45534555                }
    45544556
    4555                 if ( 'text/html' !== get_option( 'html_type' ) || 'xhtml' === $doctype ) {
     4557                // The $html_type option may be false on a new install on the setup-config.php page.
     4558                if ( ( $html_type && 'text/html' !== $html_type ) || 'xhtml' === $doctype ) {
    45564559                        $attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
    45574560                }
Note: See TracChangeset for help on using the changeset viewer.