Changeset 10515
- Timestamp:
- 02/06/2009 06:06:20 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/update-core.php
r10050 r10515 255 255 256 256 // Force refresh of update information 257 delete_ option('update_core');257 delete_transient('update_core'); 258 258 259 259 // Remove maintenance file, we're done. -
trunk/wp-admin/includes/update.php
r10150 r10515 34 34 $dismissed = get_option( 'dismissed_update_core' ); 35 35 if ( !is_array( $dismissed ) ) $dismissed = array(); 36 $from_api = get_ option( 'update_core' );36 $from_api = get_transient( 'update_core' ); 37 37 if ( empty($from_api) ) 38 38 return false; … … 72 72 73 73 function find_core_update( $version, $locale ) { 74 $from_api = get_ option( 'update_core' );74 $from_api = get_transient( 'update_core' ); 75 75 if ( !is_array( $from_api->updates ) ) return false; 76 76 $updates = $from_api->updates; … … 147 147 148 148 function wp_plugin_update_row( $file, $plugin_data ) { 149 $current = get_ option( 'update_plugins' );149 $current = get_transient( 'update_plugins' ); 150 150 if ( !isset( $current->response[ $file ] ) ) 151 151 return false; … … 174 174 175 175 // Is an update available? 176 $current = get_ option( 'update_plugins' );176 $current = get_transient( 'update_plugins' ); 177 177 if ( !isset( $current->response[ $plugin ] ) ) 178 178 return new WP_Error('up_to_date', __('The plugin is at the latest version.')); … … 269 269 270 270 // Force refresh of plugin update information 271 delete_ option('update_plugins');271 delete_transient('update_plugins'); 272 272 273 273 if( empty($filelist) ) -
trunk/wp-admin/menu.php
r10403 r10515 59 59 $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php'); 60 60 61 $update_plugins = get_ option( 'update_plugins' );61 $update_plugins = get_transient( 'update_plugins' ); 62 62 $update_count = 0; 63 63 if ( !empty($update_plugins->response) ) -
trunk/wp-includes/update.php
r10238 r10515 27 27 $php_version = phpversion(); 28 28 29 $current = get_ option( 'update_core' );29 $current = get_transient( 'update_core' ); 30 30 if ( ! is_object($current) ) 31 31 $current = new stdClass; … … 41 41 // Update last_checked for current to prevent multiple blocking requests if request hangs 42 42 $current->last_checked = time(); 43 update_option( 'update_core', $current );43 set_transient( 'update_core', $current ); 44 44 45 45 if ( method_exists( $wpdb, 'db_version' ) ) … … 85 85 $updates->last_checked = time(); 86 86 $updates->version_checked = $wp_version; 87 update_option( 'update_core', $updates);87 set_transient( 'update_core', $updates); 88 88 } 89 89 add_action( 'init', 'wp_version_check' ); … … 114 114 $plugins = get_plugins(); 115 115 $active = get_option( 'active_plugins' ); 116 $current = get_ option( 'update_plugins' );116 $current = get_transient( 'update_plugins' ); 117 117 if ( ! is_object($current) ) 118 118 $current = new stdClass; … … 146 146 // Update last_checked for current to prevent multiple blocking requests if request hangs 147 147 $current->last_checked = time(); 148 update_option( 'update_plugins', $current );148 set_transient( 'update_plugins', $current ); 149 149 150 150 $to_send = (object)compact('plugins', 'active'); … … 171 171 $new_option->response = array(); 172 172 173 update_option( 'update_plugins', $new_option );173 set_transient( 'update_plugins', $new_option ); 174 174 } 175 175 … … 197 197 198 198 $installed_themes = get_themes( ); 199 $current_theme = get_ option( 'update_themes' );199 $current_theme = get_transient( 'update_themes' ); 200 200 if ( ! is_object($current_theme) ) 201 201 $current_theme = new stdClass; … … 211 211 // Update last_checked for current to prevent multiple blocking requests if request hangs 212 212 $current_theme->last_checked = time(); 213 update_option( 'update_themes', $current_theme );213 set_transient( 'update_themes', $current_theme ); 214 214 215 215 $themes = array( ); … … 241 241 $new_option->response = $response; 242 242 243 update_option( 'update_themes', $new_option );243 set_transient( 'update_themes', $new_option ); 244 244 } 245 245 … … 255 255 */ 256 256 function _maybe_update_plugins() { 257 $current = get_ option( 'update_plugins' );257 $current = get_transient( 'update_plugins' ); 258 258 if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) ) 259 259 return; … … 271 271 */ 272 272 function _maybe_update_themes( ) { 273 $current = get_ option( 'update_themes' );273 $current = get_transient( 'update_themes' ); 274 274 if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) ) 275 275 return;
Note: See TracChangeset
for help on using the changeset viewer.