[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 05:12:00 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:
------------------------------------------------+--------------------------

Comment (by mikeschinkel):

 Replying to [comment:2 mbijon]:
 > For admin_messages, I'm not sure that requiring plugin devs to test
 $page now or get_current_screen is a good idea. That's a very different
 requirement from most filters. Could we have a different hook per-
 location?

 While I don't have strong feelings about using my patch as-is, I will
 disagree that requiring a `$pagenow` test is different from most filters.
 I just searched our main plugin code base and we have over 25 places where
 I had to test `$pagenow` in order to get the correct behavior.

 That said, I don't ''prefer'' having to check `$pagenow` because it
 requires exception-based programming which is prone to side-effects and
 errors.  One solution might be to use `"{$pagenow}-admin_messages"` but
 I'd hate to loose the generic `"admin_messages"` in case the use-case is
 not `$pagenow` specific.


 > And, if we keep admin_messages like it is now, could it be renamed to
 more explicitly than just by pluralizing, maybe
 'before_all_admin_messages' or 'before_multiple_admin_messages' ?

 Good point about making them easier to differentiate, although those hooks
 names are a bit long, no?  How about:

 - `admin_message_list` and `admin_message`

 Or

 - `admin_messages` and `indexed_admin_message`

 Or

 - ...?

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


More information about the wp-trac mailing list