From ff8e7c03d29f5f2c43a67341d4f25ae0bf6b94d8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 11 Feb 2018 17:27:17 +0000 Subject: [PATCH] Administration: Make sure `wp.updates.addAdminNotice` is displayed after the page header and does not unexpectedly push down "Add New" and other buttons. Props shivapoudel. Fixes #41221. git-svn-id: https://develop.svn.wordpress.org/trunk@42700 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/updates.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index 7bb1167f6c..f9d161f948 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -167,7 +167,9 @@ * */ wp.updates.addAdminNotice = function( data ) { - var $notice = $( data.selector ), $adminNotice; + var $notice = $( data.selector ), + $headerEnd = $( '.wp-header-end' ), + $adminNotice; delete data.selector; $adminNotice = wp.updates.adminNotice( data ); @@ -179,6 +181,8 @@ if ( $notice.length ) { $notice.replaceWith( $adminNotice ); + } else if ( $headerEnd.length ) { + $headerEnd.after( $adminNotice ); } else { if ( 'customize' === pagenow ) { $( '.customize-themes-notifications' ).append( $adminNotice );