Ticket #10220: 10220.diff
File 10220.diff, 2.2 KB (added by , 16 years ago) |
---|
-
wp-includes/update.php
201 201 $timeout = 'load-themes.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours 202 202 $time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked ); 203 203 204 if( $time_not_changed ) 204 $themes = array(); 205 $checked = array(); 206 $themes['current_theme'] = (array) $current_theme; 207 foreach( (array) $installed_themes as $theme_title => $theme ) { 208 $themes[$theme['Stylesheet']] = array(); 209 $checked[$theme['Stylesheet']] = $theme['Version']; 210 211 foreach( (array) $theme as $key => $value ) { 212 $themes[$theme['Stylesheet']][$key] = $value; 213 } 214 } 215 216 $theme_changed = false; 217 foreach ( $checked as $slug => $v ) { 218 $new_option->checked[ $slug ] = $v; 219 220 if ( !isset( $current_theme->checked[ $slug ] ) || strval($current_theme->checked[ $slug ]) !== strval($v) ) 221 $theme_changed = true; 222 } 223 224 if ( isset ( $current_theme->response ) && is_array( $current_theme->response ) ) { 225 foreach ( $current_theme->response as $slug => $update_details ) { 226 if ( ! isset($checked[ $slug ]) ) { 227 $theme_changed = true; 228 break; 229 } 230 } 231 } 232 233 if( $time_not_changed && !$theme_changed ) 205 234 return false; 206 235 207 236 // Update last_checked for current to prevent multiple blocking requests if request hangs … … 210 239 211 240 $current_theme->template = get_option( 'template' ); 212 241 213 $themes = array( );214 $themes['current_theme'] = (array) $current_theme;215 foreach( (array) $installed_themes as $theme_title => $theme ) {216 $themes[$theme['Stylesheet']] = array( );217 218 foreach( (array) $theme as $key => $value ) {219 $themes[$theme['Stylesheet']][$key] = $value;220 }221 }222 223 242 $options = array( 224 243 'timeout' => 3, 225 244 'body' => array( 'themes' => serialize( $themes ) ), … … 235 254 return false; 236 255 237 256 $response = unserialize( $raw_response['body'] ); 238 if( $response ) 257 if( $response ) { 258 $new_option->checked = $checked; 239 259 $new_option->response = $response; 260 } 240 261 241 262 set_transient( 'update_themes', $new_option ); 242 263 }