[wp-trac] [WordPress Trac] #20946: Improve 'Right Now' in Network Admin

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 16 00:53:19 UTC 2012


#20946: Improve 'Right Now' in Network Admin
-----------------------------+------------------------------
 Reporter:  DrewAPicture     |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Network Admin    |     Version:  3.4
 Severity:  normal           |  Resolution:
 Keywords:  ui-feedback      |
-----------------------------+------------------------------

Comment (by scribu):

 I remembered that to insert an item into the admin bar, you have to rely
 on hook priority, which is a pretty round-about way of doing it, IMO.

 How about something more like jQuery:

 {{{
 $right_now->append( array(
   'id' => 'user-count',
   'label' => _n_noop( 'User', 'Users' ),
   'count' => 1000
   'url' => ...
 ) );
 }}}

 We can generate both the number and text classes from the 'id' key.

 This would just add the element at the end of the list.

 We'd also have:

 {{{
 $right_now->prepend( array(
   ...
 ) );

 $right_now->insert_before( 'some-other-id', array(
   ...
 ) );

 $right_now->insert_after( 'some-other-id', array(
   ...
 ) );

 $right_now->replace( 'some-other-id', array(
   ...
 ) );

 $item = $right_now->get( 'some-other-id' );

 $right_now->remove( 'some-other-id' );
 }}}

 This could also be used for the regular admin box.

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


More information about the wp-trac mailing list