From d9b935e3cee694b5067ffd7280adc2b65242ddb1 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 1 Apr 2010 10:42:03 +0000 Subject: [PATCH] Delete _transient_timeout_$name and _site_transient_timeout_$name when specifically deleting transients. Fixes #12782 git-svn-id: https://develop.svn.wordpress.org/trunk@13911 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0842371b16..932c6f399e 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -680,8 +680,11 @@ function delete_transient( $transient ) { if ( $_wp_using_ext_object_cache ) { $result = wp_cache_delete( $transient, 'transient' ); } else { + $option_timeout = '_transient_timeout_' . $transient; $option = '_transient_' . $transient; $result = delete_option( $option ); + if ( $result ) + delete_option( $option_timeout ); } if ( $result ) @@ -3581,8 +3584,11 @@ function delete_site_transient( $transient ) { if ( $_wp_using_ext_object_cache ) { $result = wp_cache_delete( $transient, 'site-transient' ); } else { + $option_timeout = '_site_transient_timeout_' . $transient; $option = '_site_transient_' . $transient; $result = delete_site_option( $option ); + if ( $result ) + delete_site_option( $option_timeout ); } if ( $result ) do_action( 'deleted_site_transient', $transient );