Changes between Initial Version and Version 1 of Ticket #12738, comment 6
- Timestamp:
- 04/11/2011 11:14:20 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12738, comment 6
initial v1 1 1 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 2 2 3 global $admin_notices; 4 $admin_notices[] = array('updated', 'Hello World!'); '3 global $admin_notices;[[BR]] 4 $admin_notices[] = array('updated', 'Hello World!'); 5 5 6 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. 6 then core would handle the rest. Or you could have a function that you pass the message type and the message content into and it could add it to the global array for the developer than it's as easy as: 7 8 add_admin_notice('updated', 'Hello World!'); 9 10 If this is something you think would work, I can attach a diff of the code I use in my plugins to do this.