Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #12738, comment 6


Ignore:
Timestamp:
04/11/2011 11:14:20 PM (14 years ago)
Author:
john316media
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12738, comment 6

    initial v1  
    11THe 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
    22
    3 global $admin_notices;
    4 $admin_notices[] = array('updated', 'Hello World!');'
     3global $admin_notices;[[BR]]
     4$admin_notices[] = array('updated', 'Hello World!');
    55
    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.
     6then 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
     8add_admin_notice('updated', 'Hello World!');
     9
     10If this is something you think would work, I can attach a diff of the code I use in my plugins to do this.