[wp-trac] [WordPress Trac] #19691: Cannot modify admin messages for /wp-admin/edit.php

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 30 17:22:07 UTC 2011


#19691: Cannot modify admin messages for /wp-admin/edit.php
------------------------------------------------+--------------------------
 Reporter:  mikeschinkel                        |       Owner:
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Administration                      |  Review
 Severity:  normal                              |     Version:  3.3
 Keywords:  dev-feedback has-patch 2nd-opinion  |  Resolution:
------------------------------------------------+--------------------------
Changes (by mikeschinkel):

 * cc: mikeschinkel@… (added)


Comment:

 Replying to [comment:4 mbijon]:
 > I can barely remember at times. Maybe we keep the generic one, but
 rename to {{{'before_admin_messages'}}}.

 Hmm.  Doesn't labeling a hook with `'before_*'` imply that there is also
 an `'after_*'`?  Having that ''"before"'' indicator without an ''"after"''
 would confuse me more than not.

 When I made the patch I was only trying to tackle the plural use-case and
 threw in the singular use-case because I found it while searching code.
 Your comments have made me question the difference between the two use-
 cases ''(plural and singular)'' and the best I could come up with is that
 there is only an implementation difference, not a conceptual one.

 So I've updated the patch to always use `'admin_messages'`, even for the
 singular case because it's easily conceivable someone might want to add a
 message to an area that currently only has single messages. Thus the patch
 converts all single messages to an array and passes thru the
 `'admin_messages'` filter.  This created one situation where we ideally
 need an `'error_messages'` filter too, which the patch has too.

 In reviewing all the message handling code in WordPress core's admin area
 it's painfully obvious that it should all be consolidated into a singular
 message handling function, but I won't tackle that without the core devs
 blessing first.

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


More information about the wp-trac mailing list