Add "Skip to content" link to all screens in the admin, fixes #21361

git-svn-id: http://core.svn.wordpress.org/trunk@21305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-07-23 22:00:06 +00:00
parent e5fcf53e85
commit 3df1783276
2 changed files with 6 additions and 1 deletions

View File

@ -107,6 +107,7 @@ if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_them
?>
<div id="wpwrap">
<a id="wpbody-content-shortcut" tabindex="5" href="#wpbody-content" class="hide-if-no-js screen-reader-text"><?php _e('Skip to main content'); ?></a>
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
<div id="wpcontent">
@ -122,7 +123,7 @@ $current_screen->set_parentage( $parent_file );
?>
<div id="wpbody-content">
<div id="wpbody-content" tabindex="-1" aria-label="<?php esc_attr_e('Main content'); ?>">
<?php
$current_screen->render_screen_meta();

View File

@ -361,6 +361,10 @@ $(document).ready( function() {
});
}
$('#wpbody-content-shortcut').bind('click.wp-skip-to-content', function(e){
$('#wpbody-content').focus();
e.preventDefault();
});
});
// internal use