Make WordPress Core


Ignore:
Timestamp:
11/04/2008 05:12:03 PM (16 years ago)
Author:
ryan
Message:

Fix core update checking. Don't check on every page load.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update.php

    r9441 r9512  
    3535    if ( !is_array( $dismissed ) ) $dismissed = array();
    3636    $from_api = get_option( 'update_core' );
    37     if ( !is_array( $from_api ) ) return false;
     37    if ( empty($from_api) )
     38        return false;
     39    if ( !is_array( $from_api->updates ) ) return false;
     40    $updates = $from_api->updates;
     41    if ( !is_array( $updates ) ) return false;
    3842    $result = array();
    39     foreach($from_api as $update) {
     43    foreach($updates as $update) {
    4044        if ( array_key_exists( $update->current.'|'.$update->locale, $dismissed ) ) {
    4145            if ( $options['dismissed'] ) {
     
    6973function find_core_update( $version, $locale ) {
    7074    $from_api = get_option( 'update_core' );
    71     if ( !is_array( $from_api ) ) return false;
    72     foreach($from_api as $update) {
     75    if ( !is_array( $from_api->updates ) ) return false;
     76    $updates = $from_api->updates;
     77    foreach($updates as $update) {
    7378        if ( $update->current == $version && $update->locale == $locale )
    7479            return $update;
Note: See TracChangeset for help on using the changeset viewer.