mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Use transient for update_core, update_plugins, update_themes. see #9048
git-svn-id: https://develop.svn.wordpress.org/trunk@10515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -33,7 +33,7 @@ function get_core_updates( $options = array() ) {
|
||||
$options = array_merge( array('available' => true, 'dismissed' => false ), $options );
|
||||
$dismissed = get_option( 'dismissed_update_core' );
|
||||
if ( !is_array( $dismissed ) ) $dismissed = array();
|
||||
$from_api = get_option( 'update_core' );
|
||||
$from_api = get_transient( 'update_core' );
|
||||
if ( empty($from_api) )
|
||||
return false;
|
||||
if ( !is_array( $from_api->updates ) ) return false;
|
||||
@@ -71,7 +71,7 @@ function undismiss_core_update( $version, $locale ) {
|
||||
}
|
||||
|
||||
function find_core_update( $version, $locale ) {
|
||||
$from_api = get_option( 'update_core' );
|
||||
$from_api = get_transient( 'update_core' );
|
||||
if ( !is_array( $from_api->updates ) ) return false;
|
||||
$updates = $from_api->updates;
|
||||
foreach($updates as $update) {
|
||||
@@ -146,7 +146,7 @@ function update_right_now_message() {
|
||||
}
|
||||
|
||||
function wp_plugin_update_row( $file, $plugin_data ) {
|
||||
$current = get_option( 'update_plugins' );
|
||||
$current = get_transient( 'update_plugins' );
|
||||
if ( !isset( $current->response[ $file ] ) )
|
||||
return false;
|
||||
|
||||
@@ -173,7 +173,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
||||
add_filter('update_feedback', $feedback);
|
||||
|
||||
// Is an update available?
|
||||
$current = get_option( 'update_plugins' );
|
||||
$current = get_transient( 'update_plugins' );
|
||||
if ( !isset( $current->response[ $plugin ] ) )
|
||||
return new WP_Error('up_to_date', __('The plugin is at the latest version.'));
|
||||
|
||||
@@ -268,7 +268,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
||||
$wp_filesystem->delete($working_dir, true);
|
||||
|
||||
// Force refresh of plugin update information
|
||||
delete_option('update_plugins');
|
||||
delete_transient('update_plugins');
|
||||
|
||||
if( empty($filelist) )
|
||||
return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
|
||||
|
||||
Reference in New Issue
Block a user