Make WordPress Core


Ignore:
Timestamp:
11/15/2013 03:04:00 AM (10 years ago)
Author:
dd32
Message:

Updates: Force an update check to occur when the 'Check Again' button is used in the Dashboard. Fixes #25831

File:
1 edited

Legend:

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

    r26188 r26192  
    1919 *
    2020 * @param array $extra_stats Extra statistics to report to the WordPress.org API.
     21 * @param bool $force_check Whether to bypass the transient cache and force a fresh update check. Defaults to false, true if $extra_stats is set.
    2122 * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
    2223 */
    23 function wp_version_check( $extra_stats = array() ) {
     24function wp_version_check( $extra_stats = array(), $force_check = false ) {
    2425    if ( defined('WP_INSTALLING') )
    2526        return;
     
    4243    }
    4344
     45    if ( ! empty( $extra_stats ) )
     46        $force_check = true;
     47
    4448    // Wait 60 seconds between multiple version check requests
    4549    $timeout = 60;
    4650    $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
    47     if ( $time_not_changed && empty( $extra_stats ) )
     51    if ( ! $force_check && $time_not_changed )
    4852        return false;
    4953
     
    9599    );
    96100
    97     if ( $extra_stats )
     101    if ( is_array( $extra_stats ) )
    98102        $post_body = array_merge( $post_body, $extra_stats );
    99103
Note: See TracChangeset for help on using the changeset viewer.