0

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>

result of the error

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

1 Answer 1

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>
2
  • Did you edit the WP core? Jan 25, 2021 at 16:09
  • 1
    @Tony, no, not at all. I added a link to the code in the Core in my answer
    – brasofilo
    Jan 26, 2021 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.