[wp-trac] [WordPress Trac] #11515: Admin needs standardized way of handling messages (notices) displayed to the user

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 10 03:14:36 UTC 2010


#11515: Admin needs standardized way of handling messages (notices) displayed to
the user
----------------------------+-----------------------------------------------
 Reporter:  filosofo        |       Owner:                              
     Type:  enhancement     |      Status:  new                         
 Priority:  normal          |   Milestone:  3.0                         
Component:  Administration  |     Version:  3.0                         
 Severity:  normal          |    Keywords:  error-message admin-messages
----------------------------+-----------------------------------------------

Comment(by ptahdunbar):

 I've been dealing with this issue too when creating my own plugin
 messages. I've used a combination of what the WP_Upgrader class does + the
 $_GET['message'] global..

 Here's an outline:
 - function that registers all message codes with their values
 - during form processing, add any feedback messages (like errors or
 success) to a $message array.
 - explode that array by commas to it can be sent back on wp_redirect once
 form processing is complete
 - a template function that parses the $message var and echos the actual
 message to the user.

 One thing with preregistering messages is that you can only have generic
 messages. For instance, creating a new category would be "Category added."
 instead of a more personalized "The News category has been added". So
 variables can't be accessed when using the WP_Upgrader messaging approach.
 I'd really like to figure out a way to have a standardized way of
 displaying messages to the user with the ability to personalize the
 messages based on the results of form processing.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11515#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list