Make WordPress Core

Opened 2 years ago

Closed 3 months ago

#19069 closed defect (bug) (wontfix)

Admin menu generation doesn't check whether default post types have 'show_ui' as true

Reported by: kawauso Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: administration Cc:


While patching #19055, I found wp-admin/menu.php doesn't check whether default post types have 'show_ui' set to true. The Comments menu is also displayed regardless of whether available post types support comments or not.

Attachments (1)

19069.diff (5.2 KB) - added by kawauso 2 years ago.
First pass

Download all attachments as: .zip

Change History (6)

kawauso2 years ago

First pass

comment:1 kawauso2 years ago

  • Component changed from General to Administration
  • Keywords has-patch added

First pass at checking the show_ui flag and post type support for comments.

comment:2 johnbillion2 years ago

  • Cc johnbillion@… added

comment:3 nacin2 years ago

Technically speaking, there's no proper way to set show_ui to false for pages or posts. I'm not saying there shouldn't be, but there isn't a way to modify a post type definition. remove_menu_page() seems like a good alternative for now.

Generally speaking, post type support refers to UI only, but I'm not sure if comments should depend on the implicit situation where no post types are linked to them. Could comments be used for something else other than a direct post link? (Think orphaned attachments or terms attached to links or users — both odd situations we need to account for.)

comment:4 jeremyfelt3 months ago

  • Component changed from Administration to Menus
  • Focuses administration added

comment:5 nacin3 months ago

  • Component changed from Menus to Posts, Post Types
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

remove_menu_page() seems like a good alternative for now.

Note: See TracTickets for help on using tickets.