[wp-trac] [WordPress Trac] #13912: Not aware of post_type so "wp-has-current-submenu" get assigned incorrectly

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 15 20:46:12 UTC 2010


#13912: Not aware of post_type so "wp-has-current-submenu" get assigned incorrectly
--------------------------+-------------------------------------------------
 Reporter:  benjitastic   |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------

Comment(by benjitastic):

 Replying to [comment:1 nacin]:
 > I would imagine it is due to your use of the same value, __FILE__, in
 the $menu_slug parameter, which needs to be unique.

 Thanks for the quick reply nacin.

 The problem is that I am looping through all post_type and adding a menu
 item under each. It would be tricky to have a unique menu_slug for each
 since there is not a defined number of post_type and I would like every
 sub nav item to point to the main .php plugin file - '__FILE__'.

 {{{
 foreach(get_post_types('','names') as $r) {
         if(!in_array($r, $excludedPostTypes)) {
                 add_submenu_page('edit.php?post_type='.$r.'', "Reorder",
 "Reorder", $minlevel,  __FILE__, 'reorder_ui');
         }
 }
 }}}

 Do you have any idea how I could accomplish this?

 Thanks!

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


More information about the wp-trac mailing list