id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
14860 """Updated"" message DIV jumping around Edit Post screen" Alhadis "Okay, so I'm developing a plugin that uses a separate form tag on the Edit Posts screen to manage custom attributes. This form's inserted into the header using the ""in_admin_header"" action.
Now, to keep the same consistent formatting, I've used the same class names as used by the headings on the rest of the page:
{{{

Edit Properties

...

}}}
Now, whenever the page is published or updated, the ""Updated"" message box suddenly jumps from the top of the page into the form. Looking through the source for a bit, I found the culprit:
'''./wp-admin/js/common.dev :: Lines 197-199'''
{{{
// Move .updated and .error alert boxes. Don't move boxes designed to be inline.
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
$('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') );
}}}
This little script is assuming that the first

tag it finds is the one being displayed at the top of the page to the user. Now, I know the obvious solution here would simply be to move the form's source to the page's footer, but I still think this is a clumsy solution to an otherwise preventable issue.
Can't the Edit Page's heading be assigned an ID so the script can place the ""updated"" box more accurately? I don't want to duplicate CSS rules in my layout simply to reapply the same formatting using a different tag (e.g., ""

Edit Properties

""), as this'd simply be a messier approach. I think the script should be looking for a H2 tag with an ID (or at least a specific CSS class) to place the message box." defect (bug) closed normal JavaScript 3.0.1 minor invalid close