WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 12 months ago

#12917 closed defect (bug) (invalid)

Unable to browser media library within custom post type

Reported by: mattwiebe Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: General Keywords:
Focuses: Cc:

Description

When creating/editing a custom post type "post" in 3.0 beta, you are unable to access the media library using the "Add Image" browser.

If you click the "Media Library" tab in the Thickbox popup, it correctly counts the number of items in the library, but doesn't show any of them. This makes it impossible to use already uploaded images for post content or thumbnails.

If you upload an image on that post, the "Gallery (n)" tab appears as expected.

I've uploaded a screenshot in case my description wasn't awesome.

Attachments (1)

media-library.png (55.2 KB) - added by mattwiebe 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @scribu
11 years ago

Can't reproduce.

Usign r14041 and a post type 'test', the media gallery works normally (the thickbox is missing it's title, though).

#2 @mattwiebe
11 years ago

Thanks for checking scribu.

I investigated further, thinking that the problem may have been with my custom post type being named 'media'. I didn't think that it should cause a problem, since WP's media library uses a post type of 'attachment'.

The problem turned out to be that I added a taxonomy of "type" to the "media" post type. Again, that didn't seem to be a clash with WP's built-in taxonomies, but removing it solved the problem. So, unless the taxonomy of "type" is somehow actually reserved, there's a problem somewhere in the register_taxonomy() API.

#3 @scribu
11 years ago

  • Milestone 3.0 deleted
  • Resolution set to invalid
  • Status changed from new to closed

'type' is reserved for the media type. You'll notice that the URL to the thickbox has ?type=image in it.

#4 @scribu
11 years ago

Also see #12929

#6 @SergeyBiryukov
12 months ago

#48468 was marked as a duplicate.

Note: See TracTickets for help on using tickets.