[wp-trac] [WordPress Trac] #12453: _wp_menu_output() needs to use add_query_arg()

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 2 10:21:08 UTC 2010


#12453: _wp_menu_output() needs to use add_query_arg()
--------------------------+-------------------------------------------------
 Reporter:  TobiasBg      |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.0        
Component:  Post Types    |     Version:             
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------
 I have a plugin that uses {{{add_pages_page()}}} to add a menu item to the
 "Pages" menu of the admin menu.

 Due to the Custom Post Types, the corresponding parent page was renamed
 from "edit-pages.php" to "edit.php?posttype=page".

 This breaks the URLs of plugin menu entries that are added to the "Pages"
 menu, as they will look like "edit.php?posttype=page?page=plugin-slug"
 (note the two ?).

 The reason for this is in the lower part of {{{_wp_menu_output()}}} in wp-
 admin/menu-header.php, where the "?page=" is hard-coded, like
 {{{href='{$item[2]}?page={$sub_item[2]}'}}}
 instead of using {{{add_query_arg()}}}.

 There are checks for ? in URLs in that function, but they don't seem to
 get applied for submenu entries.

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


More information about the wp-trac mailing list