Helper: Make sure transients are not empty before setting again.

This commit is contained in:
Konstantin Kovshenin 2017-08-28 10:53:48 +03:00
parent 578f25ebdc
commit 51a2d45578
1 changed files with 9 additions and 2 deletions

View File

@ -291,8 +291,15 @@ class WC_Helper_Updater {
delete_transient( '_woocommerce_helper_updates_count' );
// Refresh update transients
set_site_transient( 'update_plugins', get_site_transient( 'update_plugins' ) );
set_site_transient( 'update_themes', get_site_transient( 'update_themes' ) );
$update_plugins = get_site_transient( 'update_plugins' );
if ( ! empty( $update_plugins ) ) {
set_site_transient( 'update_plugins', $update_plugins );
}
$update_themes = get_site_transient( 'update_themes' );
if ( ! empty( $update_themes ) ) {
set_site_transient( 'update_themes', $update_themes );
}
}
/**