WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#20029 closed defect (bug) (duplicate)

preview button shown on post screen with non-public custom post types

Reported by: intoxstudio Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Posts, Post Types Keywords: has-patch 2nd-opinion ux-feedback
Focuses: Cc:

Description

Registering a custom post type with the following arguments

$args = array(
'public' => false,
'show_ui' => true
);

means that the post type shouldn't be public but still shown in the administration (obviously). Therefore it makes no sense that a preview button is visible on the post screen, as it will lead to nothing (404); ie. the use case is nonexistent.

This patch checks if a post type is public before adding the preview button to the post screen.

Attachments (1)

meta-boxes.php.diff (833 bytes) - added by intoxstudio 2 years ago.

Download all attachments as: .zip

Change History (3)

intoxstudio2 years ago

comment:2 scribu2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.