[wp-trac] [WordPress Trac] #19460: Move filter for 'admin_body_class' to make it accessible for scripts and other stuff

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 8 01:38:37 UTC 2011


#19460: Move filter for 'admin_body_class' to make it accessible for scripts and
other stuff
-------------------------+------------------------------
 Reporter:  F J Kaiser   |       Owner:
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------
Changes (by scribu):

 * keywords:  close =>


Comment:

 A plugin can already remove classes added by other plugins:

 {{{
 function im_a_nasty_plugin() {
   return 'only-mine';
 }
 add_filter( 'admin_body_class', 'im_a_nasty_plugin' );
 }}}

 Correct would be of course:

 {{{
 function im_a_nice_plugin( $classes ) {
   $classes .= ' me-too';

   return $classes;
 }
 add_filter( 'admin_body_class', 'im_a_nice_plugin' );
 }}}

 If the intention really was to only allow adding classes, it should have
 been an action, not a filter.

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


More information about the wp-trac mailing list