Make WordPress Core

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#20453 closed defect (bug) (fixed)

Media screen links to non-public post types

Reported by: johnbillion's profile johnbillion Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

I have a non-public custom post type registered, so it doesn't get an admin UI.

A file in the media library is attached to one of my custom posts (done at the point the file is uploaded using media_handle_upload()). The media item shows up in the Media Library as expected, but the 'Attached To' column links to the editing screen for the parent post, even though the post is non-public.

This allows a user to see the post editing screen for a non-public post type.

Attachments (2)

20453.patch (910 bytes) - added by johnbillion 13 years ago.
20453.diff (1021 bytes) - added by johnbillion 11 years ago.
Refreshed patch

Download all attachments as: .zip

Change History (6)

@johnbillion
13 years ago

#1 @johnbillion
13 years ago

  • Keywords 2nd-opinion added

Attached is my patch. I fully expect this to have side effects, so this needs input from others.

Additionally, the existing logic which checks the return value of get_post() on line 298 looks erroneous to me. If it returns false then the $title variable is not going to be as expected.

#2 @nacin
13 years ago

Given your patch, by non-public, I assume you mean non-show_ui. In that case, patch looks good.

@johnbillion
11 years ago

Refreshed patch

#3 @nacin
11 years ago

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

In 25140:

Don't create an edit link to a non-UI post type in the media list table.

props johnbillion.
fixes #20453.

#4 @SergeyBiryukov
11 years ago

  • Keywords 2nd-opinion removed
  • Milestone changed from Awaiting Review to 3.7
Note: See TracTickets for help on using tickets.