Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12792 closed defect (bug) (fixed)

Custom post types cannot upload media or set thumbnails unless "editor" is enabled

Reported by: markjaquith Owned by:
Priority: normal Milestone: 3.0
Component: Post Types Version: 3.0
Severity: normal Keywords: has-patch thumbnails
Cc:

Description

Expected: setting "thumbnail" for custom post type allows for setting of thumbnail:

Observed: Unless "editor" is set, thumbnails won't work.

More:

In order to upload media or set thumbnails, the "editor" post type capability needs to be set. This isn't always desirable.

We should show the buttons if "thumbnail" is set but "editor" is not. Perhaps in its own "Media Upload" meta box.

Attachments (3)

12792.diff (6.1 KB) - added by scribu 3 years ago.
12792.2.diff (826 bytes) - added by scribu 3 years ago.
Restore thickbox title for featured images
12792.3.diff (4.0 KB) - added by scribu 3 years ago.
Conditionally display "Insert into Post" button

Download all attachments as: .zip

Change History (14)

Related: #12590

We should show the buttons if "thumbnail" is set but "editor" is not. Perhaps in its own "Media Upload" meta box.

I disagree. If you want to upload media, go to the Media screen.

To fix the thumbnail problem, we should replace jQuery('#add_image').click(); with something less presumptive.

  • Keywords has-patch added; custom post types, removed

scribu3 years ago

To fix the thumbnail problem, we should replace jQuery('#add_image').click(); with something less presumptive.

attachment 12792.diff added

Nicely done! Solves that issues very cleanly.

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

(In [14015]) Make thumbnail work for custom post types even if the editor is not being displayed. props scribu. fixes #12792

(In [14030]) TB_iframe fixes for stuff that broke in r14015. props scribu. fixes #12878. see #12792

scribu3 years ago

Restore thickbox title for featured images

  • Resolution fixed deleted
  • Status changed from closed to reopened

When clicking "Set featured image", the thickbox title is blank. This is fixed in 12792.2.diff.

When the editor isn't displayed, we should also remove the "Insert into Post" button.

scribu3 years ago

Conditionally display "Insert into Post" button

(In [14118]) More tweaks for thumbnail support when no editor support for custom post types. see #12792, props scribu.

  • Resolution set to fixed
  • Status changed from reopened to closed

This seems good for me. Re-open if it not, or open a new ticket.

$_GETpost_id? is not always present, specifically, on the 2nd load of a async upload, only fetch & attachment_id are passed.

(In [14146]) Use the correct field when determining if the parent can support the Post Editor. See #12792

Note: See TracTickets for help on using tickets.