diff --git src/wp-admin/admin.php src/wp-admin/admin.php
index 2dd315d..d456bac 100644
|
|
require_once(ABSPATH . 'wp-admin/includes/admin.php'); |
83 | 83 | |
84 | 84 | auth_redirect(); |
85 | 85 | |
86 | | // Schedule trash collection |
87 | | if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) |
88 | | wp_schedule_event(time(), 'daily', 'wp_scheduled_delete'); |
89 | | |
90 | 86 | set_screen_options(); |
91 | 87 | |
92 | 88 | $date_format = __( 'F j, Y' ); |
diff --git src/wp-admin/post-new.php src/wp-admin/post-new.php
index ac80f13..01025ab 100644
|
|
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_ |
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
65 | | // Schedule auto-draft cleanup |
66 | | if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) |
67 | | wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); |
68 | | |
69 | 65 | wp_enqueue_script( 'autosave' ); |
70 | 66 | |
71 | 67 | if ( is_multisite() ) { |
diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index 5a73975..3a7a2a9 100644
|
|
add_action( 'rss2_head', 'rss2_site_icon' ); |
285 | 285 | // WP Cron |
286 | 286 | if ( !defined( 'DOING_CRON' ) ) |
287 | 287 | add_action( 'init', 'wp_cron' ); |
| 288 | add_action( 'init', 'wp_schedule_garbage_collection' ); |
288 | 289 | |
289 | 290 | // 2 Actions 2 Furious |
290 | 291 | add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); |
diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 8593e8c..ad7f302 100644
|
|
function _cleanup_header_comment( $str ) { |
4663 | 4663 | } |
4664 | 4664 | |
4665 | 4665 | /** |
| 4666 | * Schedule events for garbage collection. |
| 4667 | * |
| 4668 | * Ensure that trashed posts and auto-drafts get garbage-collected by WP Cron. |
| 4669 | * |
| 4670 | * @since 4.7.0 |
| 4671 | */ |
| 4672 | function wp_schedule_garbage_collection() { |
| 4673 | if ( wp_installing() ) { |
| 4674 | return; |
| 4675 | } |
| 4676 | |
| 4677 | // Ensure that auto-draft posts will get garbage-collected. |
| 4678 | if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) { |
| 4679 | wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); |
| 4680 | } |
| 4681 | |
| 4682 | // Schedule trash collection. |
| 4683 | if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) ) { |
| 4684 | wp_schedule_event( time(), 'daily', 'wp_scheduled_delete' ); |
| 4685 | } |
| 4686 | } |
| 4687 | |
| 4688 | /** |
4666 | 4689 | * Permanently delete comments or posts of any type that have held a status |
4667 | 4690 | * of 'trash' for the number of days defined in EMPTY_TRASH_DAYS. |
4668 | 4691 | * |