[wp-trac] [WordPress Trac] #9657: Allow custom screen_meta dropdown panels

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 23 16:23:45 UTC 2011


#9657: Allow custom screen_meta dropdown panels
----------------------------+-----------------------------
 Reporter:  hakre           |       Owner:  ptahdunbar
     Type:  enhancement     |      Status:  accepted
 Priority:  normal          |   Milestone:  Future Release
Component:  Administration  |     Version:  3.0
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |
----------------------------+-----------------------------

Comment (by ptahdunbar):

 Updated the patch with some bug fixes and improvements.

 Here's an example usage. It adds two blank tabs to the dashboard as well
 as a global tab with some content.
 {{{
 add_action( 'screen_meta', 'how_to_screen_meta_api_example' );
 function how_to_screen_meta_api_example() {
         add_screen_meta_tab( 'foobar', __( 'Foobar' ), 'dashboard' );
         add_screen_meta_tab( 'barfoo', __( 'Barfoo' ), 'dashboard',
 'read', 8 );

         add_screen_meta_tab( 'new-tab', __( 'This is a new tab' ),
 'global' );
         add_screen_meta_section( 'example-1', 'how_to_example_1', 'new-
 tab' );
         add_screen_meta_section( 'example-2', 'how_to_example_2', 'new-
 tab', 9 );
 }

 function how_to_example_1() {
         ?>
         <h5>Example 1</h5>
         <p>This is an example of how to add a custom screen meta section.
 w00t!</p>
         <?php
 }

 function how_to_example_2() {
         ?>
         <h5>Example 2</h5>
         <p>Anything can go inside here. Maybe a form? Totally. Although,
 you'll still have to do all the heavy lifting etc.</p>
         <p>How about some lorem ipsum? Sure, why not.</p>
         <p>Nullam auctor suscipit orci sit amet accumsan. Suspendisse sit
 amet lectus nibh, et scelerisque diam. Nullam tincidunt, lectus id
 vestibulum venenatis, libero enim porta magna, sed scelerisque erat massa
 et arcu. Nulla quis vehicula turpis. Vestibulum pulvinar nunc eget lorem
 interdum nec placerat justo commodo. Proin auctor lacus sed mauris posuere
 vehicula. Quisque sed urna vel magna rutrum euismod. Mauris dictum lectus
 vel tellus posuere varius ut et dolor. Ut tortor libero, pulvinar at
 vehicula a, hendrerit nec orci. Ut dictum, mauris a vehicula commodo, nisi
 ligula porttitor magna, id vehicula odio lectus in sapien.</p>
         <?php
 }
 }}}

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


More information about the wp-trac mailing list