[wp-trac] [WordPress Trac] #12922: Setting featured image does not require the post to be saved

WordPress Trac noreply at wordpress.org
Mon Apr 18 13:58:52 UTC 2016


#12922: Setting featured image does not require the post to be saved
-----------------------------+------------------------------
 Reporter:  rooodini         |       Owner:
     Type:  defect (bug)     |      Status:  reopened
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Post Thumbnails  |     Version:  3.0
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------------------
Changes (by flixos90):

 * keywords:  needs-patch => has-patch


Comment:

 [attachment:12922.diff] is a take on this ticket.

 The featured thumbnail ID is stored in a hidden input field with name
 `_thumbnail_id` which is submitted when hitting the "Update" button and
 then handled by `edit_post()`.

 The AJAX function for `set-post-thumbnail` is no longer used, instead a
 new AJAX function for `get-post-thumbnail-html` is used to render the
 metabox content (basically providing a preview, similar to the original
 `set-post-thumbnail` function, only without actually modifying the post).

 Additionally I moved all thumbnail management for the post editor into the
 `media-editor.js` file so that we don't need to use the global JS function
 `WPRemoveThumbnail` any longer.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/12922#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list