From 7c71467f1d6a90b32624a7ff738baed237595dc3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 2 Jan 2016 03:31:28 +0000 Subject: [PATCH] Admin: fix repositioning of notices when the first header is not an immediate children of `.wrap`. Merges [36134] to the 4.4 branch. Props afercia, DvanKooten. Fixes #35047. git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36144 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/common.js | 2 +- src/wp-includes/js/autosave.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/common.js b/src/wp-admin/js/common.js index 796e1400f4..9d7fa4158c 100644 --- a/src/wp-admin/js/common.js +++ b/src/wp-admin/js/common.js @@ -397,7 +397,7 @@ $document.ready( function() { * The `.below-h2` class is here just for backwards compatibility with plugins * that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570. */ - $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $( '.wrap' ).children( ':header' ).first() ); + $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $( '.wrap h1, .wrap h2' ).first() ); // Make notices dismissible function makeNoticesDismissible() { diff --git a/src/wp-includes/js/autosave.js b/src/wp-includes/js/autosave.js index 0ffc293f5b..85d5f84193 100644 --- a/src/wp-includes/js/autosave.js +++ b/src/wp-includes/js/autosave.js @@ -346,7 +346,7 @@ window.autosave = function() { }; $notice = $( '#local-storage-notice' ) - .insertAfter( $( '.wrap' ).children( ':header' ).first() ) + .insertAfter( $( '.wrap h1, .wrap h2' ).first() ) .addClass( 'notice-warning' ) .show();