[wp-trac] [WordPress Trac] #22022: Can’t properly add pages of type edit.php?post_type=xxx as submenu items to arbitrary parent menus

WordPress Trac noreply at wordpress.org
Fri Jan 11 04:12:16 UTC 2013


#22022: Can’t properly add pages of type edit.php?post_type=xxx as submenu items to
arbitrary parent menus
-------------------------------+------------------------------
 Reporter:  jjharr             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Administration     |     Version:  3.4.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => reporter-feedback


Comment:

 Could not reproduce with the following code:
 {{{
 function codex_custom_init() {
     $args = array( 'public' => true, 'label' => 'Books', 'show_in_menu' =>
 false );
     register_post_type( 'book', $args );
 }
 add_action( 'init', 'codex_custom_init' );

 function dummy_page() {
         echo 'test';
 }

 function test_22022() {
         add_menu_page('My Pages', 'My Pages', 'edit_posts', 'parentslug',
 'dummy_page');
         add_submenu_page('parentslug', 'Settings', 'Settings',
 'edit_posts', 'mysettings', 'dummy_page');
         add_submenu_page('parentslug', 'Custom Post Type', 'Custom Post
 Type', 'edit_posts', 'edit.php?post_type=book');
 }
 add_action( 'admin_menu', 'test_22022' );
 }}}

 `$parent_file` and the submenu slug are the same (`parentslug`), so the
 `'wp-has-current-submenu wp-menu-open'` classes apply properly.

 Am I missing something?

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


More information about the wp-trac mailing list