[wp-trac] [WordPress Trac] #9818: a wp_notification field
WordPress Trac
wp-trac at lists.automattic.com
Thu May 14 09:28:26 GMT 2009
#9818: a wp_notification field
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: UI | Version: 2.8
Severity: normal | Keywords: needs-patch
-------------------------------+--------------------------------------------
On occasion, a plugin needs to return some kind of feedback. It would be
nice if a standard hook existed for this.
It could go something like this:
add_filter(wp_notification, foobar)
foobar() appends to an array of notification messages that get displayed
to the user on the front end.
then, on page load:
- in wp_head if notifications is not empty, we add a style,
wp_notification, that makes elements of this class invisible, and we load
jQuery
- if do_action(wp_notification) is explicitly called on the page, we
display the messages in there, without the class, and disable the
notification on the wp_footer hook
- an action gets fired on wp_footer if do_action(wp_notification) is not
called, and we use ajax to place the needed messages in a absolutely
positioned div element, with a close button.
we could also add some kind of do_action(wp_commentform_notification),
nearby the comments form, to output comment-related errors in their
"correct" location as well.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9818>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list