WordPress.org

Make WordPress Core

Ticket #5066: updateoption-2.diff

File updateoption-2.diff, 2.7 KB (added by intoxination, 7 years ago)
  • wp-admin/includes/update.php

     
    2828function update_nag() { 
    2929        $cur = get_option( 'update_core' ); 
    3030 
     31        if (!get_option("check_updates") && current_user_can('manage_options')){ 
     32                echo "<div id='update-nag'>".__('Please <a href="options-privacy.php">select</a> if you would like to have auto-updates enabled')."</div>"; 
     33                return; 
     34        } 
    3135        if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) 
    3236                return false; 
    3337 
     
    4246 
    4347function wp_update_plugins() { 
    4448        global $wp_version; 
     49        if (get_option("check_updates")!='true') 
     50                return; 
    4551 
    4652        if ( !function_exists('fsockopen') ) 
    4753                return false; 
  • wp-admin/options-privacy.php

     
    2222<?php do_action('blog_privacy_selector'); ?> 
    2323</td> 
    2424</tr> 
     25<tr valign="top"> 
     26<th scope="row"><?php _e('Automatic Update Notification:') ?> </th> 
     27<td> 
     28<p><input id="check_updates" type="radio" name="check_updates" value="true" <?php checked("true", get_option('check_updates')); ?> /> 
     29<label for="check_updates"><?php _e('I would like for my Wordpress to automatically connect to wordpress.org and check for updated versions of Wordpress and my plugins');?></label></p> 
     30<p><input id="no_update_check" type="radio" name="check_updates" value="false" <?php checked("false", get_option('check_updates')); ?> /> 
     31<label for="no_update_check"><?php _e('No thanks. I understand that I will be responsible to check for updated versions of Wordpress and my plugins.');?></label></p> 
     32<p><em>Note that during this check certain information is sent to the wordpress.org servers. This information includes your current version, version of PHP and URL of your site.</p> 
     33<?php do_action('blog_privacy_selector'); ?> 
     34</td> 
     35</tr> 
    2536</table> 
    2637 
    2738<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /> 
    2839<input type="hidden" name="action" value="update" /> 
    29 <input type="hidden" name="page_options" value="blog_public" /> 
     40<input type="hidden" name="page_options" value="blog_public,check_updates" /> 
    3041</p> 
    3142</form> 
    3243 
  • wp-includes/update.php

     
    88 
    99        global $wp_version; 
    1010        $php_version = phpversion(); 
     11        if (get_option("check_updates")!='true') 
     12                return; 
    1113 
    1214        $current = get_option( 'update_core' ); 
    1315        $locale = get_locale();