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
This commit is contained in:
parent
b2aaeb8394
commit
d9b935e3ce
|
@ -680,8 +680,11 @@ function delete_transient( $transient ) {
|
||||||
if ( $_wp_using_ext_object_cache ) {
|
if ( $_wp_using_ext_object_cache ) {
|
||||||
$result = wp_cache_delete( $transient, 'transient' );
|
$result = wp_cache_delete( $transient, 'transient' );
|
||||||
} else {
|
} else {
|
||||||
|
$option_timeout = '_transient_timeout_' . $transient;
|
||||||
$option = '_transient_' . $transient;
|
$option = '_transient_' . $transient;
|
||||||
$result = delete_option( $option );
|
$result = delete_option( $option );
|
||||||
|
if ( $result )
|
||||||
|
delete_option( $option_timeout );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
|
@ -3581,8 +3584,11 @@ function delete_site_transient( $transient ) {
|
||||||
if ( $_wp_using_ext_object_cache ) {
|
if ( $_wp_using_ext_object_cache ) {
|
||||||
$result = wp_cache_delete( $transient, 'site-transient' );
|
$result = wp_cache_delete( $transient, 'site-transient' );
|
||||||
} else {
|
} else {
|
||||||
|
$option_timeout = '_site_transient_timeout_' . $transient;
|
||||||
$option = '_site_transient_' . $transient;
|
$option = '_site_transient_' . $transient;
|
||||||
$result = delete_site_option( $option );
|
$result = delete_site_option( $option );
|
||||||
|
if ( $result )
|
||||||
|
delete_site_option( $option_timeout );
|
||||||
}
|
}
|
||||||
if ( $result )
|
if ( $result )
|
||||||
do_action( 'deleted_site_transient', $transient );
|
do_action( 'deleted_site_transient', $transient );
|
||||||
|
|
Loading…
Reference in New Issue