[wp-trac] [WordPress Trac] #37887: Make attachments atomic until a Customizer session is published

WordPress Trac noreply at wordpress.org
Tue Aug 30 16:50:19 UTC 2016


#37887: Make attachments atomic until a Customizer session is published
----------------------------+-----------------------------
 Reporter:  fjarrett        |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 == Current behavior ==

 When you upload attachments via a Customizer session they are:

 1. Added to the filesystem.
 2. Saved to the database as a new post.
 3. Immediately visible in the Media Library to all other logged in users.

 == Desired behavior ==

 Attachments that are uploaded during a Customizer session should not be
 published, or even visible by other logged in users, until the user
 decides to publish the changes.

 == Possible idea

 Until Customizer changed are published, all `attachment` posts that have
 been uploaded inside the Customizer could have their post status set to
 `auto-draft` rather than `inherit`. This will make them invisible inside
 the Media Library from other logged in users.

 All `attachment` posts uploaded during the Customizer session could be
 stored inside the new Customizer transaction, and the Media Library query
 could be made to only show those uploads during the current unpublished
 session.

 == Publish or Discard

 If a transaction is '''published''', then the post status on these
 `attachment` IDs can be set to `inherit`, making them visible inside in
 the Media Library like normal.

 If a transaction is '''discarded''', then the `attachment` IDs can be
 force deleted via `wp_delete_attachment( $ID, true )` which will not only
 delete them from the database, but also from the filesystem.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37887>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list