Opened 19 months ago

Last modified 18 months ago

#19069 new defect (bug)

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

Reported by: kawauso Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version:
Severity: normal Keywords: has-patch
Cc: johnbillion@…

Description

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 19 months ago.
First pass

Download all attachments as: .zip

Change History (4)

First pass

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

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

  • Cc johnbillion@… added

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.)

Note: See TracTickets for help on using tickets.