WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9146 closed defect (bug) (fixed)

Admin Page Title Missing for Plugin Without Submenus

Reported by: clwill Owned by: clwill
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

If you create a plugin that has nothing but a menu page, but no submenus, the title of the admin page is missing. This is a problem for a simple plugin that needs only one page of options, but those options are unrelated to Wordpress and therefore don't fit in the standard WP menus of "Appearance", "Settings", "Tools", etc.

Attached to this ticket is a simple plugin that demonstrates the problem.

Attachments (2)

missing-title.php (617 bytes) - added by clwill 5 years ago.
Plugin that demonstrates the missing admin title problem
plugin.diff (591 bytes) - added by clwill 5 years ago.
Diff file that demonstrates a simple fix for this bug

Download all attachments as: .zip

Change History (13)

clwill5 years ago

Plugin that demonstrates the missing admin title problem

comment:1 clwill5 years ago

Attached is a patch for wp-admin/includes/plugin.php that presents a simple fix to this bug. The resolution is simply, if the entire process is followed, and no title is still found, use the menu page's title.

clwill5 years ago

Diff file that demonstrates a simple fix for this bug

comment:2 Speedboxer5 years ago

  • Keywords has-patch added

comment:3 Speedboxer5 years ago

  • Keywords plugin admin page title removed

comment:4 ryan5 years ago

Usage of __FILE is deprecated. It will lead to misery. Try an arbitrary ID string.

comment:5 follow-up: josephscott5 years ago

The title being talked about here is the HTML <title>. Confirmed that this is a problem, even when not using __FILE__ and that the patch fixes it.

comment:6 follow-up: ryan5 years ago

Alrighty then. In it goes.

comment:7 in reply to: ↑ 5 clwill5 years ago

Replying to josephscott:

The title being talked about here is the HTML <title>. Confirmed that this is a problem, even when not using __FILE__ and that the patch fixes it.

Right, I was just using an arbitrary string... I just happened to pick "FILE" as a demo of the problem. My bad.

comment:8 in reply to: ↑ 6 clwill5 years ago

Replying to ryan:

Alrighty then. In it goes.

Thx.

comment:9 ryan5 years ago

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

comment:10 ryan5 years ago

  • Component changed from Plugins to Menus

comment:11 ryan5 years ago

Added a Menus component that auto-assigns to me so that I'll be more likely to notice menu tickets. :-)

Note: See TracTickets for help on using tickets.