Skip to content

Commit b24d8fb

Browse files
committed
Network and Sites: Improve a11y of network admin pages.
Improves the accessibility of two network/multisite related admin screens: * My sites: Converts site name and "Global Settings" (available via filter) headings to `h2` to avoid skipping a heading level * Network setup: - associates fields with their descriptive text with `aria-describedby` attributes - converts section headings to `h2` to avoid skipping a heading level Developed in #13819 Props mitgiselle, johnjamesjacoby, afercia. Fixes #66205. git-svn-id: https://develop.svn.wordpress.org/trunk@64013 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6681f58 commit b24d8fb

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎src/wp-admin/includes/network.php‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function network_step1( $errors = false ) {
240240

241241
if ( allow_subdomain_install() && allow_subdirectory_install() ) :
242242
?>
243-
<h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3>
243+
<h2><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h2>
244244
<p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?>
245245
<strong><?php _e( 'You cannot change this later.' ); ?></strong></p>
246246
<p><?php _e( 'You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality.' ); ?></p>
@@ -289,7 +289,7 @@ function network_step1( $errors = false ) {
289289
$is_www = str_starts_with( $hostname, 'www.' );
290290
if ( $is_www ) :
291291
?>
292-
<h3><?php esc_html_e( 'Server Address' ); ?></h3>
292+
<h2><?php esc_html_e( 'Server Address' ); ?></h2>
293293
<p>
294294
<?php
295295
printf(
@@ -317,7 +317,7 @@ function network_step1( $errors = false ) {
317317
</table>
318318
<?php endif; ?>
319319

320-
<h3><?php esc_html_e( 'Network Details' ); ?></h3>
320+
<h2><?php esc_html_e( 'Network Details' ); ?></h2>
321321
<table class="form-table" role="presentation">
322322
<?php if ( 'localhost' === $hostname ) : ?>
323323
<tr>
@@ -378,17 +378,17 @@ function network_step1( $errors = false ) {
378378
<tr>
379379
<th scope='row'><label for="sitename"><?php esc_html_e( 'Network Title' ); ?></label></th>
380380
<td>
381-
<input name='sitename' id='sitename' type='text' size='45' value='<?php echo esc_attr( $site_name ); ?>' />
382-
<p class="description">
381+
<input name='sitename' id='sitename' type='text' size='45' aria-describedby='sitename-desc' value='<?php echo esc_attr( $site_name ); ?>' />
382+
<p class="description" id="sitename-desc">
383383
<?php _e( 'What would you like to call your network?' ); ?>
384384
</p>
385385
</td>
386386
</tr>
387387
<tr>
388388
<th scope='row'><label for="email"><?php esc_html_e( 'Network Admin Email' ); ?></label></th>
389389
<td>
390-
<input name='email' id='email' type='text' size='45' value='<?php echo esc_attr( $admin_email ); ?>' />
391-
<p class="description">
390+
<input name='email' id='email' type='text' size='45' aria-describedby='email-desc' value='<?php echo esc_attr( $admin_email ); ?>' />
391+
<p class="description" id="email-desc">
392392
<?php _e( 'Your email address.' ); ?>
393393
</p>
394394
</td>
@@ -470,7 +470,7 @@ function network_step2( $errors = false ) {
470470

471471
if ( $_POST || ! is_multisite() ) {
472472
?>
473-
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
473+
<h2><?php esc_html_e( 'Enabling the Network' ); ?></h2>
474474
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
475475
<?php
476476
$notice_message = '<strong>' . __( 'Caution:' ) . '</strong> ';

‎src/wp-admin/my-sites.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
$settings_html = apply_filters( 'myblogs_options', '', 'global' );
125125

126126
if ( $settings_html ) {
127-
echo '<h3>' . __( 'Global Settings' ) . '</h3>';
127+
echo '<h2>' . __( 'Global Settings' ) . '</h2>';
128128
echo $settings_html;
129129
}
130130

@@ -134,7 +134,7 @@
134134
switch_to_blog( $user_blog->userblog_id );
135135

136136
echo '<li>';
137-
echo "<h3>{$user_blog->blogname}</h3>";
137+
echo "<h2>{$user_blog->blogname}</h2>";
138138

139139
$actions = "<a href='" . esc_url( home_url() ) . "'>" . __( 'Visit' ) . '</a>';
140140

0 commit comments

Comments
 (0)