Make WordPress Core

Opened 3 hours ago

#62087 new enhancement

Add `inline` support to the new `wp_get_admin_notice()` function

Reported by: clorith's profile Clorith Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.4
Component: General Keywords:
Focuses: Cc:

Description

The introduction of wp_get_admin_notice() is a good move to unify how admin notices are generated, and makes it easier down the road to change these as needed.

One element that is currently missing, although it can be added using the additional_classes argument, is the inline reference.

Admin notices will by default always be moved, by JavaScript, to immediately follow the h1 tag of a page, but adding the inline class will leave it in the position it is generated. This exists as there are various cases where the admin notice markup is used by plugins, themes, and core to bring emphasis to a notice or warning that is context aware.

Since the function is intended to generate the markup and return it, this should ideally be an explicit boolean value introduced to the function as well for ease of use, and to bring awareness.

Change History (0)

Note: See TracTickets for help on using tickets.