[wp-trac] [WordPress Trac] #16050: Add 'menu_page' and 'submenu_page' hooks

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 17 09:30:18 UTC 2011


#16050: Add 'menu_page' and 'submenu_page' hooks
-----------------------------+-------------------------
 Reporter:  mikeschinkel     |       Owner:
     Type:  enhancement      |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Administration   |     Version:  3.1
 Severity:  normal           |  Resolution:  maybelater
 Keywords:  menus has-patch  |
-----------------------------+-------------------------

Comment (by mikeschinkel):

 Another issue with the admin menu system I just came across. Let's assume
 the requirements are to:

  1.) Make the Dashboard menu page have no submenus, and

  2.) Make the Dashboard menu page link to `/wp-
 admin/index.php?page=analytics360.php`

 The menu system seems to again force it's will over my plugin's code yet
 again. If I use this in an `'admin_menu'` hook:

 {{{
 add_menu_page('Dashboard','Dashboard','read','index.php?page=analytics360.php',false,false,2);
 }}}

 The link becomes an unworkable:

 {{{
 /wp-admin/admin.php?page=index.php?page=analytics360.php
 }}}

 Oh the other hand if I use this instead the dashboard won't load:

 {{{
 add_menu_page('Dashboard','Dashboard','read','analytics360.php',false,false,2);
 }}}

 And if I use this the then the dashboard loads again:

 {{{
 add_menu_page('Dashboard','Dashboard','read','page=analytics360.php',false,false,2);
 }}}

 But the link is broken yet again:

 {{{
 /wp-admin/page=analytics360.php
 }}}

 It appears to be a catch-22, no way around this in current WordPress.  Now
 I anticipate someone will say ''"Use a different URL structure like this
 instead"'', something like this:

 {{{
 /wp-admin/admin.php?page=analytics360.php
 }}}

 And normally I would agree except in my use-case where I ran into this
 problem I was trying to link to the
 [http://www.mailchimp.com/wordpress_analytics_plugin/ MailChimp Analytics
 360 plugin]'s dashboard instead of the default dashboard, and I didn't
 want to have to modify their code. Yes I can figure out a way to hack
 around this but it is indeed a hack.

 So once again, please reconsider adding these hooks and the main one need
 on ticket #16204.

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


More information about the wp-trac mailing list