[wp-trac] [WordPress Trac] #19371: As of 3.3beta2 WP_Admin_Bar no longer provides a way to access attributes of existing menu items

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 27 17:46:38 UTC 2011


#19371: As of 3.3beta2 WP_Admin_Bar no longer provides a way to access attributes
of existing menu items
--------------------------+------------------
 Reporter:  willshouse    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.3
Component:  Admin Bar     |     Version:
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by scribu):

 * keywords:   => has-patch
 * component:  General => Admin Bar
 * severity:  normal => minor
 * milestone:  Awaiting Review => 3.3


Comment:

 One solution would be to make remove_menu() return the args. Example
 usage:

 {{{
 add_action( 'admin_bar_menu', function( $admin_bar ) {
         $node = $admin_bar->remove_menu( 'user-info' );

         $node['meta']['class'] = 'foo';

         $admin_bar->add_menu( $node );
 }, 99 );
 }}}

 See [[attachment:19371.diff]]

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


More information about the wp-trac mailing list