[wp-trac] [WordPress Trac] #12453: Custom Post Types break admin menu

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 3 20:01:01 UTC 2010


#12453: Custom Post Types break admin menu
--------------------------+-------------------------------------------------
 Reporter:  TobiasBg      |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.0        
Component:  Post Types    |     Version:             
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------

Comment(by TobiasBg):

 Thanks for the patch.

 Access also works fine now.

 I investigated on the submenu highlight. Problem is that the check
 {{{($item[2] == $self)}}}[http://core.trac.wordpress.org/browser/trunk/wp-
 admin/menu-header.php#L123 in this line] is false, because {{{$self}}} is
 == {{{'edit.php'}}}, while {{{$self}}} is still ==
 {{{'edit.php?post_type=page'}}}.

 {{{$self}}} seems to come from
 [http://core.trac.wordpress.org/browser/trunk/wp-admin/menu-header.php#L16
 here], while {{{$item[2]}}} eventually is defined
 [http://core.trac.wordpress.org/browser/trunk/wp-admin/menu.php#L78 here],
 I believe.

 This might also be related to the change in menu.php of your patch. I
 don't know if just removing the querystring is a good idea, as then two
 menu entries could have the same hookname, although they are in different
 menus. A submenu under "Posts" has "posts_page_plugin-hook" before and
 after introduction of post types, while a submenu under "Pages" has
 "pages_page_plugin-hook" before but "posts_page_plugin-hook" after.
 Instead of removing the querystring, we should maybe map the page post
 type to "pages", i.e. with the $compat array
 [http://core.trac.wordpress.org/browser/trunk/wp-admin/menu.php#L183
 here].

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


More information about the wp-trac mailing list