[wp-trac] [WordPress Trac] #12254: Move show_message() into WP_Error class and add support for various WP_Error features that are missing

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 25 20:34:51 UTC 2010


#12254: Move show_message() into WP_Error class and add support for various
WP_Error features that are missing
--------------------------+-------------------------------------------------
 Reporter:  jeremyclarke  |       Owner:  jeremyclarke
     Type:  enhancement   |      Status:  new         
 Priority:  normal        |   Milestone:  3.0         
Component:  General       |     Version:              
 Severity:  normal        |    Keywords:              
--------------------------+-------------------------------------------------

Comment(by jeremyclarke):

 '''@nacin:''' I don't think looking at show_message() as defined entirely
 by its current hacked-together use is productive or necessary. IMHO it was
 added as a convenience and without consideration of its position in the
 larger WP_Error ecosystem. I'm trying to fill in the gaps and figure out
 what it SHOULD be doing rather than what it does now (which is get in the
 way of fixing the updates system because it has no actual display
 configurability). It's title implies a generic utility rather than a
 specific one. If it is truly only for use in updaters it should be changed
 to show_updater_message() or something like that, though IMHO even such a
 function should call the new, more powerful show_message() function to
 generate output.


 '''Message types and colors:''' In IRC today jane wells and I discussed
 the current colors/message types situation and how it could be improved.
 We discussed how currently there are only two kinds of messages:

  * updated - yellow
  * error - red

 This fails to account for a lot of different kinds of problems that need
 to be shown in the UI. For example, how to state that the current
 situation is unnacceptable even when there was no submission (e.g.
 something missing).

 The ideas we had for types fall into these rough groups, with their most
 logical color choices:

  * updated/confirmed - GREEN (currently yellow) - When a submission has
 gone well and changes were saved.
  * error - RED - When a submission somehow failed and reason for failure.
  * notice/warning - YELLOW - A message for the user about the current
 state of affairs regardless of whether a form was just submitted.

 This would allow almost all messages to be presented usefully and
 semantically to users using show_message() along with the appropriate
 message type. On some pageloads there could be two related messages, one
 about the submission result and one about the current status, using
 updated/error for the submission result and notice/warning for the status
 message. (i.e. "ERROR: invalid email submitted. WARNING: No email
 currently saved")

 '''Potential color inconsistency with plugins:''' PeteMall worried that
 changing the meaning of yellow from 'upated/confirmed' to 'warning/notice'
 would cause plugin conflicts, but IMHO this is a fairly safe compromise to
 make. The difference is subtle and no users will be freaked out by a
 yellow plugin. This is especially unthreatening compared with the lack of
 a consistent message/error taxonomy to guide UI development in the rest of
 WP core.

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


More information about the wp-trac mailing list