#47891 closed defect (bug) (fixed)
TwentyEleven Skip Link Placement Not First In <body>
Reported by: | williampatton | Owned by: | poena |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 5.2.2 |
Component: | Bundled Theme | Keywords: | has-patch has-screenshots |
Focuses: | accessibility | Cc: |
Description
It was reported that TwentyEleven has a skip link that does not appear as the first thing inside the <body>
. For a11y reasons I believe that having the skip link, where one exists, as the first content is highly preferable.
Related comment:
https://core.trac.wordpress.org/ticket/47053#comment:4
This ticket proposes we swap to using a hook based approach to adding bypass links here and then use that same approach across all of the default themes - ultimately making it the standard way of themes adding their initial skip links.
Using the wp_body_open
hook with fallback it is possible as outlined in this comment on that same ticket: https://core.trac.wordpress.org/ticket/47053#comment:2
Attachments (4)
Change History (17)
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
5 years ago
#4
@
5 years ago
- Keywords has-patch added; needs-patch removed
The patch(es) removes the existing skip links from the nav
in header.php,
and re-adds them directly below the body tag using the wp_body_open hook in functions.php
It also styles the visible skip links to better match the skip links used by WordPress core.
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
5 years ago
#6
@
5 years ago
- Keywords commit added
I just double checked and there is a piece of back-compat code already in place in the theme that ensures this patch works correctly for WP versions before 5.2 (where wp_body_open
was introduced).
This is ready for commit.
#8
@
5 years ago
I will provide an updated patch later today that has the adjustments in rtl stylesheet and the version bump included. Thanks for pointing those out :)
#10
@
5 years ago
@afercia I did think that too but then I second guessed myself ha! I will omit it from this patch here with the note that committer should bump the version string.
Discussed during today's accessibility bug scrub. Agreed that using
wp_body_open
sounds sensible. Could also be a new best practice to be introduced with Twenty Twenty.