[wp-trac] [WordPress Trac] #12738: Notice Helper
WordPress Trac
wp-trac at lists.automattic.com
Mon Apr 11 23:10:40 UTC 2011
#12738: Notice Helper
-----------------------------+-----------------------------
Reporter: andddd | Owner:
Type: feature request | Status: assigned
Priority: lowest | Milestone: Future Release
Component: Plugins | Version:
Severity: minor | Resolution:
Keywords: |
-----------------------------+-----------------------------
Comment (by john316media):
THe one issue with this is you still have to hook into admin_notices and
have a function that calls this helper function to generate the message.
What I do in my plugins is I create a global array, each element of the
array is then another array consisting of the message type "updated" or
"error" the the message. I then hook into admin_noteces once and itterate
though the array echoing out the appropriatie divs and messages. Perhaps
that might be something that could be implimented, then its as simple as
global $admin_notices;
$admin_notices[] = array('updated', 'Hello World!');'
then core would handle the rest. If this is something you think would
work, I can attach a diff of the code I use in my plugins to do this.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12738#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list