Skip to content

Commit

Permalink
Themes: Add an ID to the block theme skip link.
Browse files Browse the repository at this point in the history
Add the ID `wp-skip-link` to the block theme generated skip link, so that block themes have a standardized target at the top of the `body` element.

Props philliproth, audrasjb, debarghyabanerjee, sabernhardt, joedolson, apermo.
Fixes #62311.

git-svn-id: https://develop.svn.wordpress.org/trunk@59559 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
joedolson committed Dec 23, 2024
1 parent 9dd87b8 commit 70ecc6b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/wp-includes/theme-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ function wp_enqueue_block_template_skip_link() {
// Create the skip link.
skipLink = document.createElement( 'a' );
skipLink.classList.add( 'skip-link', 'screen-reader-text' );
skipLink.id = 'wp-skip-link';
skipLink.href = '#' + skipLinkTargetID;
skipLink.innerHTML = '<?php /* translators: Hidden accessibility text. */ esc_html_e( 'Skip to content' ); ?>';

Expand Down

0 comments on commit 70ecc6b

Please sign in to comment.