From 8c79025acac0cc03995470a5b857979f842d8ff0 Mon Sep 17 00:00:00 2001 From: Rashed Hossain Date: Fri, 21 Aug 2026 15:39:45 +0600 Subject: [PATCH] Administration: Limit page jumping by scoping admin notice relocation to direct children of #wpbody-content. In `common.js`, `$('div.updated, div.error, div.notice')` was un-scoped, selecting all notices anywhere on the page (including inside `.wrap`, list tables, metaboxes, and contextual areas) and moving them to `.wp-header-end`. This caused unnecessary DOM manipulation, re-ordering, and unexpected layout shift (page jumps) on overview pages such as `edit.php`. This scopes the selector to only move notices that are direct children of `#wpbody-content` (i.e. those output before `.wrap` by `admin-header.php`), leaving in-page and table notices intact in their authored positions. Fixes #65877. See #45186. --- src/js/_enqueues/admin/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js index c3d49310e8897..5d2c863563136 100644 --- a/src/js/_enqueues/admin/common.js +++ b/src/js/_enqueues/admin/common.js @@ -1087,7 +1087,7 @@ $( function() { if ( ! $headerEnd.length ) { $headerEnd = $( '.wrap h1, .wrap h2' ).first(); } - $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd ); + $( '#wpbody-content > div.updated, #wpbody-content > div.error, #wpbody-content > div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd ); /** * Makes notices dismissible.