[wp-trac] [WordPress Trac] #44786: Autosave: Conditionally allow revisions to be saved

WordPress Trac noreply at wordpress.org
Mon Aug 13 22:45:46 UTC 2018


#44786: Autosave: Conditionally allow revisions to be saved
-------------------------+-----------------------------
 Reporter:  jblz         |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Revisions    |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------------
 As is, when the `DOING_AUTOSAVE` constant is truthy, calling
 `wp_save_post_revision` immediately exits.

 One of the first things that endpoints responsible for `autosave`s are
 doing is set this constant -- making it impossible to save a revision
 using the Revisions API during the same request context.

 See:
 -
 [https://github.com/WordPress/gutenberg/blob/751a2fcdd7952fd4359984af292cc669cee065c8/lib
 /class-wp-rest-autosaves-controller.php#L169 Gutenberg]
 -
 [https://github.com/Automattic/jetpack/blob/585238715b2d3ff0a10615562001a729f12ed477
 /json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php#L165
 Jetpack]

 Endpoints (& other plugins) would benefit from a filter allowing revisions
 to be saved.

 A particular use case is to occasionally save revisions for drafts during
 an `autosave` call (so there is less chance of irrecoverable data loss
 when the autosave is overwritten).

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


More information about the wp-trac mailing list