Opened 6 weeks ago
Closed 6 weeks ago
#66205 closed defect (bug) (fixed)
Minor accessibility improvements to network admin pages
| Reported by: | afercia | Owned by: | peterwilsoncc |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Networks and Sites | Version: | |
| Severity: | normal | Keywords: | has-screenshots good-first-bug has-patch commit |
| Cc: | Focuses: | accessibility, multisite |
Description
Discovered while experimenting #66015 on the network admin pages.
1
When input fields have descriptions, a well established accessibility pattern in the WordPress admin pages programmatically associates the descriptions with their related fields by the means of an aria-describedby attribute.
In the Network Setup page, two fields miss this association.
Note: don't do this on a production site:
- Add
define( 'WP_ALLOW_MULTISITE', true );in yourwp-config.phpfile. - Go to WP Admin > Tools > Network Setup.
- Observe the two input fields 'Network Title' and 'Network Admin Email' in this page have descriptions.
- Observe the descriptions are not associated with the fields.
- See first screenshot.
2
- Once you have created your test network, go to `wp-admin/my-sites.php'.
- Check the headings hierarchy.
- Observe the main H1 heading is followed by H3 headings.
- For accessibility and good semantics, heading levels should not be skipped.
- The H3 headings should be changed to H2.
- The CSS should be adjusted to not introduce changes for these headings font size.
- Note that on the
my-sites.phppage there is another 'Global Settings' H3 that is shown conditionally. It should be tested and changed to H2 as well. - See screenshot 2.
Attachments (2)
Change History (6)
This ticket was mentioned in PR #13819 on WordPress/wordpress-develop by @mitgiselle.
6 weeks ago
#1
- Keywords has-patch added
Summary
Two small accessibility fixes on the network admin screens, as described in the ticket.
Network Setup (network.php)
The "Network Title" and "Network Admin Email" fields have description text that isn't programmatically associated with the inputs. This adds an aria-describedby on each input, pointing at an id on its description paragraph (sitename-desc and email-desc), matching the pattern used elsewhere in wp-admin.
My Sites (my-sites.php)
The page's h1 is followed by h3 headings, which skips a level. The per-site heading and the conditional "Global Settings" heading are now h2. The ticket asks for the CSS to be adjusted so the font size doesn't change, but h2 and h3 share the same rule in common.css (font-size: 1.3em; margin: 1em 0), so no CSS change is needed. Nothing else in the admin stylesheets targets .my-sites h3.
Testing
Tested locally with the wordpress-develop Docker environment.
Network Setup
- Add
define( 'WP_ALLOW_MULTISITE', true );towp-config.php. Don't do this on a production site. - Go to Tools > Network Setup.
- Inspect the "Network Title" and "Network Admin Email" inputs. Each has an
aria-describedbythat matches theidof its description.
My Sites
- After creating a test network, go to
wp-admin/my-sites.php. - Check the heading order:
h1, thenh2for each site, with no skipped levels. - To check the conditional "Global Settings" heading, hook the
myblogs_optionsfilter and return some HTML when the context isglobal. It renders as anh2. - Compare the computed styles of an
h2and anh3in the same container. Font size, margin, weight and colour are identical, so there's no visual change.
phpcs passes on both files. No tests were added, as these are markup-only changes and no existing tests cover these screens.
@johnjamesjacoby commented on PR #13819:
6 weeks ago
#3
I added a follow-up commit for the additional heading-level issue found on the Network Setup page.
The four section headings rendered across the two setup steps—“Addresses of Sites in your Network,” “Server Address,” “Network Details,” and “Enabling the Network”—now use h2 rather than h3. This corrects the hierarchy beneath the page's h1 without changing the visual presentation, because the admin styles apply the same typography and spacing to these h2 and h3 elements.
I also ran the focused PHP coding standards check for src/wp-admin/includes/network.php, which passes.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The Network Setup page