[wp-trac] [WordPress Trac] #41609: Images in Customizer not deleted until Customizer is saved?

WordPress Trac noreply at wordpress.org
Fri Aug 11 18:34:55 UTC 2017


#41609: Images in Customizer not deleted until Customizer is saved?
--------------------------+------------------------------
 Reporter:  melchoyce     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.8
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by westonruter):

 * version:   => 4.8


Comment:

 I can confirm this behavior. It's due to this bit of logic:
 https://github.com/WordPress/wordpress-develop/blob/4.8.0/src/wp-
 admin/js/widgets/media-widgets.js#L688-L692

 {{{#!js
 // Disable syncing of attachment changes back to server. See
 <https://core.trac.wordpress.org/ticket/40403>.
 defaultSync = wp.media.model.Attachment.prototype.sync;
 wp.media.model.Attachment.prototype.sync = function rejectedSync() {
         return $.Deferred().rejectWith( this ).promise();
 };
 }}}

 Nevertheless, this was implemented specifically to prevent syncing of
 edits to attachment fields, rather than deletions to those attachments
 entirely. Really if we were to disable deletions, then the “Delete
 Permanently” button should be removed entirely. Or rather in keeping with
 #40403 it could be preferable to ''trash'' such an attachment to then get
 permanently deleted when the changeset is published.

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


More information about the wp-trac mailing list