[wp-hackers] Admin notices

Jeremy Clarke jer at simianuprising.com
Mon Apr 11 16:28:44 UTC 2011


On Sun, Apr 10, 2011 at 10:20 AM, scribu <mail at scribu.net> wrote:

>
> > 2) If core does not have such a function, would this be something that
> > could
> > be added, i mean if if open a trac ticket and include a patch file to add
> > my
> > function I already use in my plugins to core would it actually be likely
> to
> > be included in core or would I just be wasting my time to go thought he
> > process of a svn checkout and building a patch file.
> >
>
> I don't think such a function, by itself, would make it in. However, a more
> general messaging API to be used throughout the admin might.
>
> There was a ticket about this on trac, but I can't find it now.
>
>
This is probably the ticket you were thinking of, it has discussion on
relevant topics:

Move show_message() into WP_Error class and add support for various WP_Error
features that are missing <http://core.trac.wordpress.org/ticket/12254>
It doesn't directly solve the admin_notices issue, but support for that use
case is obvious once the show_message() situation is worked out. A WP_Error
based messaging system could be used by plugins in admin_notices to avoid
display inconsistency even if they weren't using a more global error
registration API.

I imagine transients would be the best way to implement a system for adding
a message at any time and having it shown on the next pageload in
admin_notices, though you would probably want to also use _POST to make sure
it's the same user who caused the message to be shown.

-- 
Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org


More information about the wp-hackers mailing list