From 8d56eff0733577910d6cb9b19b87d9b853d250e8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 24 Oct 2017 23:00:01 +0000 Subject: [PATCH] Transients: After [41963], add missing cron task for `delete_expired_transients()`. Props dlh. Fixes #41699. git-svn-id: https://develop.svn.wordpress.org/trunk@42008 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/admin.php | 8 +++++--- src/wp-includes/option.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/admin.php b/src/wp-admin/admin.php index 88a4aa480d..d77ab723f8 100644 --- a/src/wp-admin/admin.php +++ b/src/wp-admin/admin.php @@ -87,6 +87,11 @@ auth_redirect(); if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) wp_schedule_event(time(), 'daily', 'wp_scheduled_delete'); +// Schedule Transient cleanup. +if ( ! wp_next_scheduled( 'delete_expired_transients' ) && ! wp_installing() ) { + wp_schedule_event( time(), 'daily', 'delete_expired_transients' ); +} + set_screen_options(); $date_format = __( 'F j, Y' ); @@ -94,9 +99,6 @@ $time_format = __( 'g:i a' ); wp_enqueue_script( 'common' ); - - - /** * $pagenow is set in vars.php * $wp_importers is sometimes set in wp-admin/includes/import.php diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index fb115d30b2..719fd715ff 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -820,13 +820,13 @@ function set_transient( $transient, $value, $expiration = 0 ) { * Deletes all expired transients. * * The multi-table delete syntax is used to delete the transient record - * from table a, and the corresponding transient_timeout record from table b. + + * from table a, and the corresponding transient_timeout record from table b. * * @since 4.9.0 * * @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used. */ -function delete_expired_transients( $force_db = false) { +function delete_expired_transients( $force_db = false ) { global $wpdb; if ( ! $force_db && wp_using_ext_object_cache() ) {