Changeset 12899
- Timestamp:
- 01/29/2010 06:53:32 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/update.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/update.php
r12848 r12899 63 63 $body = str_replace(array("\r\n", "\r"), "\n", $body); 64 64 $new_options = array(); 65 foreach ( explode( "\n\n", $body ) as $entry) {65 foreach ( explode( "\n\n", $body ) as $entry ) { 66 66 $returns = explode("\n", $entry); 67 67 $new_option = new stdClass(); … … 161 161 return false; 162 162 163 if ( 200 != $raw_response['response']['code'] )163 if ( 200 != $raw_response['response']['code'] ) 164 164 return false; 165 165 … … 190 190 global $wp_version; 191 191 192 if ( defined( 'WP_INSTALLING' ) )193 return false; 194 195 if ( !function_exists( 'get_themes' ) )192 if ( defined( 'WP_INSTALLING' ) ) 193 return false; 194 195 if ( !function_exists( 'get_themes' ) ) 196 196 require_once( ABSPATH . 'wp-includes/theme.php' ); 197 197 … … 209 209 $checked = array(); 210 210 $themes['current_theme'] = (array) $current_theme; 211 foreach ( (array) $installed_themes as $theme_title => $theme ) {211 foreach ( (array) $installed_themes as $theme_title => $theme ) { 212 212 $themes[$theme['Stylesheet']] = array(); 213 213 $checked[$theme['Stylesheet']] = $theme['Version']; 214 214 215 foreach ( (array) $theme as $key => $value ) {215 foreach ( (array) $theme as $key => $value ) 216 216 $themes[$theme['Stylesheet']][$key] = $value; 217 }218 217 } 219 218 … … 235 234 } 236 235 237 if ( $time_not_changed && !$theme_changed )236 if ( $time_not_changed && !$theme_changed ) 238 237 return false; 239 238 … … 252 251 $raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options ); 253 252 254 if ( is_wp_error( $raw_response ) )255 return false; 256 257 if ( 200 != $raw_response['response']['code'] )253 if ( is_wp_error( $raw_response ) ) 254 return false; 255 256 if ( 200 != $raw_response['response']['code'] ) 258 257 return false; 259 258 260 259 $response = unserialize( $raw_response['body'] ); 261 if ( $response ) {260 if ( $response ) { 262 261 $new_option->checked = $checked; 263 262 $new_option->response = $response; … … 308 307 function _maybe_update_themes( ) { 309 308 $current = get_site_transient( 'update_themes' ); 310 if ( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) )309 if ( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) ) 311 310 return; 312 311
Note: See TracChangeset
for help on using the changeset viewer.