admin管理员组

文章数量:1305583

I have a div.notice.updated that is moving on the DOM and I can't locate the code that's doing that. Disabled all plugins and changed to a default theme without results.

I'm printing the element on the main content block and it jumps to the sidebar after the page finishes loading (it's clearly jQuery in action):

<div class="notice updated">Form sent</div>

I'm using Frank Bueltge's Admin Style plugin to get standard WP HTML code for the backend.

I have a div.notice.updated that is moving on the DOM and I can't locate the code that's doing that. Disabled all plugins and changed to a default theme without results.

I'm printing the element on the main content block and it jumps to the sidebar after the page finishes loading (it's clearly jQuery in action):

<div class="notice updated">Form sent</div>

I'm using Frank Bueltge's Admin Style plugin to get standard WP HTML code for the backend.

Share Improve this question asked Jan 25, 2021 at 15:53 brasofilobrasofilo 22.1k8 gold badges70 silver badges264 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Searching for .notice on WP source code I found the culprit at wp-admin/js/common.js:

$( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd );

Adding an inline class to my code solves the issue:

<div class="notice updated inline">Form sent</div>

本文标签: jqueryNoticeUpdated div moving around unprompted