Make WordPress Core

Ticket #9108: check-for-updates-button.diff

File check-for-updates-button.diff, 1.7 KB (added by nbachiyski, 15 years ago)
  • wp-admin/update-core.php

     
    120120        }
    121121        echo '</ul>';
    122122        dismissed_updates();
     123?>
     124        <div class="check-for-updates">
     125                <a href="?action=do-check-for-updates" class="button"><?php _e('Manually Check for Updates'); ?></a>
     126        </div>
     127<?php   
    123128        echo '</div>';
    124129}
    125130
     
    226231        if ( isset( $_POST['upgrade'] ) )
    227232                do_core_upgrade($reinstall);
    228233        include('admin-footer.php');
    229 
    230 }?>
     234} elseif ( 'do-check-for-updates' == $action ) {
     235        wp_version_check( 'skip-time-check' );
     236        $parent_file = 'tools.php';
     237        require_once('admin-header.php');
     238        core_upgrade_preamble();
     239        include('admin-footer.php');
     240}?>
     241 No newline at end of file
  • wp-includes/update.php

     
    1616 * @package WordPress
    1717 * @since 2.3.0
    1818 * @uses $wp_version Used to check against the newest WordPress version.
    19  *
     19 *
     20 * @param bool|string $skip_time_check Optional. Set to 'skipt-time-check' to force
     21 * checking for updates even if it is too soon after last update.
     22 * 
    2023 * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
    2124 */
    22 function wp_version_check() {
     25function wp_version_check( $skip_time_check = false) {
    2326        if ( defined('WP_INSTALLING') )
    2427                return;
    2528
     
    3235
    3336        $locale = get_locale();
    3437        if (
     38                $skip_time_check != 'skip-time-check' &&
    3539                isset( $current->last_checked ) &&
    3640                43200 > ( time() - $current->last_checked ) &&
    3741                $current->version_checked == $wp_version