Skip to content

Commit

Permalink
Transients: After [41963], add missing cron task for `delete_expired_…
Browse files Browse the repository at this point in the history
…transients()`.

Props dlh.
Fixes #41699.

git-svn-id: https://develop.svn.wordpress.org/trunk@42008 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Oct 24, 2017
1 parent 7329816 commit 8d56eff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,18 @@
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' );
$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
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down

0 comments on commit 8d56eff

Please sign in to comment.