[wp-trac] [WordPress Trac] #18368: Add CSS Class Info to post_updated_messages array/filter
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 10 12:50:19 UTC 2011
#18368: Add CSS Class Info to post_updated_messages array/filter
------------------------------+------------------------------------
Reporter: cgrymala | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version: 3.2.1
Severity: minor | Keywords: has-patch dev-feedback
------------------------------+------------------------------------
When saving a post, not all messages displayed on the screen are "success"
messages. Some are errors or warnings. Therefore, it would be nice to have
the ability to modify the CSS class that's applied to the notice message.
In order to support backwards-compatibility, I would suggest allowing the
array that's built using the post_updated_messages filter to support
strings (which would be the message text by itself) or arrays (which would
include one item for the message text and one item for the message class).
If a string is found, that string is assigned as the message text. If an
array is found, the first item is assigned as the message text and the
second item is assigned as the message class.
If a message class is not defined, the CSS class of 'updated' is used; if
it is found, the specified CSS class is used.
I've attached a patch for wp-admin/edit-form-advanced.php showing
basically what I'm proposing. In this case, if an array is sent as the
value of one of the messages, that array is expected to use the keys
"message" and "class"; but it could certainly be edited just to use
numeric keys if that might make more sense.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18368>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list