[wp-trac] [WordPress Trac] #38615: Round out and refine starter content

WordPress Trac noreply at wordpress.org
Tue Nov 22 02:57:05 UTC 2016


#38615: Round out and refine starter content
--------------------------------------------+--------------------------
 Reporter:  helen                           |       Owner:  westonruter
     Type:  task (blessed)                  |      Status:  accepted
 Priority:  high                            |   Milestone:  4.7
Component:  Themes                          |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  needs-testing needs-unit-tests  |     Focuses:
--------------------------------------------+--------------------------

Comment (by westonruter):

 Replying to [comment:27 helen]:
 > * Is enabling `auto-draft` for attachments a problem? Does the garbage
 collection work?

 I can confirm that the `attachment` posts with the `auto-draft` status do
 indeed get deleted via `wp_delete_auto_drafts()`, with one caveat. 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/38615#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list