1 | <?php |
---|
2 | /* |
---|
3 | Plugin name: Crazy Flyout Menu |
---|
4 | Description: Adds lots of items to WordPress' Posts menu item. |
---|
5 | Author: Erick Hitter (Oomph, Inc.) |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Adds 50 submenu items under posts |
---|
10 | * @uses add_submenu_page |
---|
11 | * @action admin_menu |
---|
12 | * @return null |
---|
13 | */ |
---|
14 | function crazy_flyout_menus_add() { |
---|
15 | for ( $i = 1; $i <= 50; $i++ ) { |
---|
16 | add_submenu_page( 'edit.php', 'Menu Entry #' . $i, 'Entry #' . $i, 'edit_posts', 'crazy-flyout-menus', 'crazy_flyout_menus_screen' ); |
---|
17 | } |
---|
18 | } |
---|
19 | add_action( 'admin_menu', 'crazy_flyout_menus_add' ); |
---|
20 | |
---|
21 | /* |
---|
22 | * Display menu page |
---|
23 | * @return string |
---|
24 | */ |
---|
25 | function crazy_flyout_menus_screen() { |
---|
26 | ?> |
---|
27 | <div class="wrap"> |
---|
28 | <h2>Crazy Flyout Menus</h2> |
---|
29 | <p>We (Oomph, Inc.) first discovered this in a client's theme. This example approximates the problem, which in the client's theme was caused by necessarily-long menu item names.</p> |
---|
30 | </div><!-- .wrap --> |
---|
31 | <?php |
---|
32 | } |
---|
33 | ?> |
---|