Make WordPress Core

Opened 20 years ago

Closed 19 years ago

Last modified 18 years ago

#1447 closed defect (bug) (fixed)

Wrong page titles in added Admin Menus

Reported by: whoismanu's profile whoismanu Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.2
Component: Administration Keywords: submenu menu admin wp-admin
Focuses: Cc:

Description

There seems to be a problem with the page titles shown for menus/submenus that have been added via

add_submenu_page(parent, page_title, menu_title, access_level, file, [function]);

You can reconstruct this problem by installing the Example plugin from the wiki page:

http://codex.wordpress.org/Adding_Administration_Menus#Example

If you install the plugin, a 'Test Options' submenu gets added to the 'Options' menu. If you click on 'Test Options' you will notice that the page title is 'Test Manage'. 'Test Manage' however is the page title of another submenu ('Test Manage') that has been added to the 'Manage' menu. The same holds for 'Test Toplevel', it also gets the page title from 'Test Manage'.

The problem seems to occur if you have several submenus that are added from the same plugin page. In this case the condition

else if (isset($plugin_page) && ($plugin_page == $submenu_array[2]))


in the 'get_admin_page_title()' function (in admin-functions.php) becomes true for the first submenu encountered and consequently all the other submenus will have the same page title.

As the same structure is also used in 'get_admin_page_parent()' you might have to check this function as well as.


Attachments (1)

admin-titles.diff (1.3 KB) - added by skeltoac 19 years ago.

Download all attachments as: .zip

Change History (5)

#1 @matt
19 years ago

  • Milestone set to 2.0

#2 @ryan
19 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3367]) Title fixes for plugin menu pages. fixes #1447

#3 @ryan
19 years ago

  • Milestone changed from 2.0 to 2.0.1

#4 @(none)
18 years ago

  • Milestone 2.0.1 deleted

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.