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

git-svn-id: https://develop.svn.wordpress.org/trunk@21305 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-07-23 22:00:06 +00:00
parent 3778e5ea4a
commit bf65e730f6
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