Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.