[wp-trac] [WordPress Trac] #38899: Customize: Ensure auto-draft deletion gets scheduled

WordPress Trac noreply at wordpress.org
Tue Nov 22 03:55:28 UTC 2016


#38899: Customize: Ensure auto-draft deletion gets scheduled
--------------------------+-----------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7
Component:  Customize     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 As [https://core.trac.wordpress.org/ticket/38615#comment:37 noted] in
 #38615:

 It turns out that the cron event that does `wp_delete_auto_drafts()` is
 only scheduled when a user lands on `post-new.php`:

 {{{#!php
 <?php
 // Schedule auto-draft cleanup
 if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
         wp_schedule_event( time(), 'daily',
 'wp_scheduled_auto_draft_delete' );
 }}}

 This logic should be added to `WP_Customize_Manager` as well so that these
 starter content auto-draft posts will get garbage collected (as well as
 the unpublished `customize_changeset` posts themselves) will get garbage-
 collected in the rare case where a user never goes to `post-new.php` on a
 given install. A user never visiting `post-new.php` is entirely possible
 if the user does all of their site management in the customizer or via the
 REST API.

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


More information about the wp-trac mailing list