Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#19237 closed defect (bug) (fixed)

admin_notices clutter the new about.php, freedoms.php, credits.php admin pages

Reported by: devinreams's profile devinreams Owned by: nacin's profile nacin
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: Administration Keywords: has-patch dev-feedback
Focuses: Cc:

Description

Regarding the new about.php et al, I'm not sure if you think this should be in another ticket like #18742 but, since the h2 for the page (nav-tab-wrapper) doesn't show up until the middle of the page (in the form of tabs) instead of intended at the top of the page, all admin_notices get cluttered up down here.

Perhaps we change the h2s to h3 and update the styles? That way the notices don't clutter the content.

(this may be an opportunity to standardize on the tabbed styles for multisite, see site-info.php)

Diff attached, didn't take a stab at the styles yet as I wasn't sure if I would nab it all correctly.

Attachments (4)

admin-screens-h3-tabs.diff (2.0 KB) - added by devinreams 12 years ago.
Switching h2s for admin page tabs to h3 to demonstrate admin_notice placement
remove-all-notices.txt (1.7 KB) - added by devinreams 12 years ago.
Removing all notices from the special informational wp-admin pages
19237.diff (1.5 KB) - added by nacin 12 years ago.
hide-notices-with-css.diff (407 bytes) - added by devinreams 12 years ago.

Download all attachments as: .zip

Change History (18)

@devinreams
12 years ago

Switching h2s for admin page tabs to h3 to demonstrate admin_notice placement

#1 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.3

#2 @nacin
12 years ago

Tempted to avoid these hooks for these special pages. That screen is a mess with notices.

We need Menu Humility for plugin notices. Looking at you, Automattic.

#3 @devinreams
12 years ago

I thought about removing the hooks, too.

Then, I wasn't sure if it wen't against the point of having these universal hooks (e.g.: a theme or plugin dev may intentionally want to add a notice on the 'About' page, perhaps?).

#4 @griffinjt
12 years ago

If users venture to any of these pages, I doubt they are concerned about the current admin notices that barrage them on every other screen. I'd be a fan of removing admin notices from these pages, too.

@devinreams
12 years ago

Removing all notices from the special informational wp-admin pages

#5 @devinreams
12 years ago

  • Owner set to devinreams
  • Status changed from new to accepted

OK, so I'm fairly convinced there's no good reason to show notices on these pages at all. So: remove all of them! (and don't touch the fancy h2's).

Attaching to remove_all_actions to all admin notices (in order seen in admin-header.php) to these 3 pages (about, credits, freedoms).

#6 @devinreams
12 years ago

  • Keywords dev-feedback added; needs-patch removed

#7 @nacin
12 years ago

Clever. I didn't think about using remove_all_actions(). Unfortunately this means that any notices that get attached on admin_head or some hook in admin-header.php would still appear. Here's an alternative hack.

@nacin
12 years ago

#8 @nacin
12 years ago

#19306 for remove_all_actions().

#9 @jane
12 years ago

Gave my thumbs up to @nacin in irc the other day on removing all notices on the post-update screen. Just documenting here as well.

#10 @devinreams
12 years ago

  • Owner changed from devinreams to nacin
  • Status changed from accepted to assigned

@nacin, do you want to stick with my patch (brute-force remove the notices) or go another route? I'm happy to help either way...

#11 @nacin
12 years ago

devinreams pointed out that 19237.diff didn't cover all_admin_notices. It was also pointed out that CSS might be doable here, since the notices are specifically being moved to be with the h2s based on class-targeting. Essentially:

/* added to 22.0 - About Pages, wp-admin.dev.css */
.about-wrap div.updated,
.about-wrap div.error {
    display: none;

Any code that does not use these classes will still appear, but at the very top of the page.

Devin, if this works for you (since you have a testbed full of them), can you turn that into a patch?

#12 @devinreams
12 years ago

OK, fair enough.

Added !important because some (like VaultPress) plugins.css can come in later with their own display:block, for instance.

#13 @nacin
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In [19393]:

Hide admin notices on the about/credits/freedoms screens. props devinreams, fixes #19237.

#14 @obenland
9 years ago

In 33113:

Hide notices introduced in [30505] on about page.

See #19237.

Props jadpm.
Fixes #32625.

Note: See TracTickets for help on using tickets.