Delete _transient_timeout_$name and _site_transient_timeout_$name when specifically deleting transients. Fixes #12782

git-svn-id: http://svn.automattic.com/wordpress/trunk@13911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-04-01 10:42:03 +00:00
parent 3344bf4a6e
commit ff3b452dda
1 changed files with 6 additions and 0 deletions

View File

@ -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 );