[wp-trac] [WordPress Trac] #45186: Admin notice jumps from above the H1 to below it when created.

WordPress Trac noreply at wordpress.org
Sun Jun 5 10:56:32 UTC 2022

#45186: Admin notice jumps from above the H1 to below it when created.
 Reporter:  dschalk         |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  4.9.8
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  ui, administration

Comment (by elpanda13@…):

 First of all, i'm sorry if the format is not the best, i'm new and not
 quite used to the standards here.

 I took a look at this issue and the real main problem is not that the
 notification is moved but that the notification is actually placed before
 the H1 tag in the first place (so the system is actually doing what is

 Here's where the code is first called in the one of settings page:

 There are other settings page where the template is pretty much the same.

 The actual call that prints the notice is found here:

 There might be a reason why the code is here (probably because it didn't
 require to modify the template's structure, maybe?) but it seems a bit out
 of place to me.

 I searched everywhere and unless i'm mistaken, it all points to options-
 head.php being used only for the settings page (and plugins maybe? this
 file seems to be used for back compatibility only, which got me confused
 as to why core is still using it?)

 At this point maybe we can fix it by requiring "options-head.php" directly
 below the H1 on each of the settings page, it seems harmless at this

 You can see a possible patch here:

 If you can confirm it as a good solution, i can send a PR.

Ticket URL: <https://core.trac.wordpress.org/ticket/45186#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list