[wp-trac] [WordPress Trac] #14145: Allow custom post types to be a submenu

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 29 23:02:25 UTC 2010


#14145: Allow custom post types to be a submenu
-----------------------------+----------------------------------------------
 Reporter:  nacin            |       Owner:     
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  3.1
Component:  Post Types       |     Version:     
 Severity:  normal           |    Keywords:     
-----------------------------+----------------------------------------------

Comment(by duck_):

 Replying to [ticket:14145 nacin]:
 > Patch mostly works. I'm finding that something in the menu handling code
 is giving wp-has-current-submenu classes to the 'Posts' menu even though
 the submenu is assigned to users.php.

 The state in the _wp_menu_output foreach loop for the Posts entry in
 $menu, when a custom post type set under tools.php is active, is:

 {{{
 global $parent_file = tools.php (set by get_admin_page_parent())
 global $self = edit.php (from $_SERVER['PHP_SELF'])

 $item[2] = edit.php (the Posts file)
 }}}

 Since there is no query string in the $parent_file var (as there normally
 would be for a custom post type) and {{{$item[2] == $self}}} the Posts
 menu gets given current status
 ([http://core.trac.wordpress.org/browser/trunk/wp-admin/menu-
 header.php#L50 menu-header.php, line 50])

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


More information about the wp-trac mailing list