Commit 1f23e99c72 for wordpress.org

commit 1f23e99c724ee094dfdfc98656497e3593416323
Author: joedolson <joedolson@git.wordpress.org>
Date:   Fri Nov 6 22:58:52 2026 +0000

    Toolbar: A11y: Add skip link to bypass the toolbar.

    When the admin bar is rendered in the footer, a link is added to skip to the toolbar. However, if it is rendered at `wp_body_open`, it injects significant repeated content at the beginning of the page with no bypass mechanism.

    Add a skip link that targets a point after the end of the admin bar when it is rendered during `wp_body_open`, allowing users to bypass the navigation, supporting WCAG 2.4.1: Bypass Blocks.

    Developed in https://github.com/WordPress/wordpress-develop/pull/14410.

    Props travisjeans, rishabhwp, ravi patel, joedolson.
    Fixes #66331.
    Built from https://develop.svn.wordpress.org/trunk@65325


    git-svn-id: http://core.svn.wordpress.org/trunk@64465 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php
index 6c8bbefd6f..c8e3427bf1 100644
--- a/wp-includes/class-wp-admin-bar.php
+++ b/wp-includes/class-wp-admin-bar.php
@@ -460,6 +460,7 @@ class WP_Admin_Bar {

 	/**
 	 * @since 3.3.0
+	 * @since 7.2.0 Added a link to skip the toolbar when it is rendered at the start of the page.
 	 *
 	 * @param object $root
 	 */
@@ -473,10 +474,19 @@ class WP_Admin_Bar {
 			$class .= ' mobile';
 		}

+		/*
+		 * On the front end, add a link to reach the toolbar when it is rendered in the footer
+		 * by themes without 'wp_body_open' support, or to skip it when it precedes the content.
+		 */
+		$skip_to_toolbar   = ! is_admin() && ! did_action( 'wp_body_open' );
+		$skip_past_toolbar = ! is_admin() && did_action( 'wp_body_open' ) && ! doing_action( 'wp_footer' );
+
 		?>
 		<div id="wpadminbar" class="<?php echo $class; ?>">
-			<?php if ( ! is_admin() && ! did_action( 'wp_body_open' ) ) { ?>
+			<?php if ( $skip_to_toolbar ) { ?>
 				<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a>
+			<?php } elseif ( $skip_past_toolbar ) { ?>
+				<a class="screen-reader-shortcut" href="#wp-toolbar-skip-target"><?php _e( 'Skip toolbar' ); ?></a>
 			<?php } ?>
 			<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>">
 				<?php
@@ -485,6 +495,9 @@ class WP_Admin_Bar {
 				}
 				?>
 			</div>
+			<?php if ( $skip_past_toolbar ) { ?>
+				<div id="wp-toolbar-skip-target"></div>
+			<?php } ?>
 		</div>

 		<?php
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 78e4eb52e9..1b42f6674c 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-beta4-65324';
+$wp_version = '7.2-beta4-65325';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.