[wp-trac] [WordPress Trac] #23836: add_submenu_page() duplicate menus

WordPress Trac noreply at wordpress.org
Fri Feb 21 19:17:41 UTC 2014


#23836: add_submenu_page() duplicate menus
------------------------------+------------------------------
 Reporter:  king_of_the_ring  |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Administration    |     Version:
 Severity:  minor             |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+------------------------------
Changes (by mordauk):

 * severity:  major => minor


Comment:

 While it really doesn't seem to cause any issues having duplicate pages,
 it does seem a bit odd to me that duplicate sub menu items are allowed.


 {{{
 function test_add_duplicate_menu_page() {
         add_submenu_page( 'plugins.php', 'Test', 'Test', 'manage_options',
 'my-test-page', '__return_null' );
         add_submenu_page( 'plugins.php', 'Test', 'Test', 'manage_options',
 'my-test-page', '__return_null' );
 }
 add_action( 'admin_menu', 'test_add_duplicate_menu_page' );
 }}}

 That, for example, will register two "Test" submenu items that both point
 to the same page.

 Is it an issue? I don't really think so but it is a bit odd. What if we
 prevented the second one from being added (or replaced the first) if all
 arguments are the same?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23836#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list