Schedule trash collection from admin page loads. see #4529

git-svn-id: http://svn.automattic.com/wordpress/trunk@12120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-10-27 18:13:42 +00:00
parent 1ada1c60de
commit 31f5798fbb
3 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,10 @@ nocache_headers();
update_category_cache();
// Schedule trash collection
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
set_screen_options();
$posts_per_page = get_option('posts_per_page');

View File

@ -393,7 +393,3 @@ function _upgrade_cron_array($cron) {
function check_server_timer( $local_time ) {
return true;
}
add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');

View File

@ -203,6 +203,7 @@ add_action( 'future_page', '_future_post_hook', 5, 2 );
add_action( 'save_post', '_save_post_hook', 5, 2 );
add_action( 'transition_post_status', '_transition_post_status', 5, 3 );
add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
// Post Image CSS class filtering
add_action( 'begin_fetch_post_image_html', '_wp_post_image_class_filter_add' );