Accessibility: Remove inappropriate content from the Posts and Edit screens headings.

Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia.

See #26601.


git-svn-id: https://develop.svn.wordpress.org/trunk@38983 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2016-10-27 20:38:09 +00:00
parent 3ffefccdf2
commit cc6925d1d5
5 changed files with 57 additions and 11 deletions
+11 -2
View File
@@ -315,7 +315,8 @@ window.autosave = function() {
var content, post_title, excerpt, $notice,
postData = getSavedPostData(),
cookie = wpCookies.get( 'wp-saving-post' ),
$newerAutosaveNotice = $( '#has-newer-autosave' ).parent( '.notice' );
$newerAutosaveNotice = $( '#has-newer-autosave' ).parent( '.notice' ),
$headerEnd = $( '.wp-header-end' );
if ( cookie === post_id + '-saved' ) {
wpCookies.remove( 'wp-saving-post' );
@@ -338,8 +339,16 @@ window.autosave = function() {
return;
}
/*
* If '.wp-header-end' is found, append the notices after it otherwise
* after the first h1 or h2 heading found within the main content.
*/
if ( ! $headerEnd.length ) {
$headerEnd = $( '.wrap h1, .wrap h2' ).first();
}
$notice = $( '#local-storage-notice' )
.insertAfter( $( '.wrap h1, .wrap h2' ).first() )
.insertAfter( $headerEnd )
.addClass( 'notice-warning' );
if ( $newerAutosaveNotice.length ) {