From 2a525d26b4db64e97ed3e9659e41629310084bca Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Tue, 17 Nov 2020 11:32:44 -0700
Subject: [PATCH] 51742.13.diff plus add a check for whether the site is under
a VCS and display a separate "auto-updates are disabled" message for that
case.
---
src/wp-admin/update-core.php | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php
index 9068fedc78..cf64adcc08 100644
a
|
b
|
function list_core_update( $update ) { |
62 | 62 | $show_buttons = true; |
63 | 63 | |
64 | 64 | if ( 'development' === $update->response ) { |
65 | | $message = __( 'You are using a development version of WordPress. You can update to the latest nightly build manually:' ); |
| 65 | $message = __( 'You can update to the latest nightly build manually:' ); |
66 | 66 | } else { |
67 | 67 | if ( $current ) { |
68 | 68 | /* translators: %s: WordPress version. */ |
… |
… |
function core_upgrade_preamble() { |
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
| 281 | echo '<h2>' . __( 'You are using a development version of WordPress' ) . '</h2>'; |
281 | 282 | echo '<ul class="core-updates">'; |
282 | 283 | foreach ( (array) $updates as $update ) { |
283 | 284 | echo '<li>'; |
… |
… |
function core_auto_updates_settings() { |
311 | 312 | $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' ); |
312 | 313 | echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>'; |
313 | 314 | } elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) { |
314 | | $notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' ); |
| 315 | $notice_text = __( 'WordPress will receive automatic security and maintenance releases from now on.' ); |
315 | 316 | echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>'; |
316 | 317 | } |
317 | 318 | } |
… |
… |
function core_auto_updates_settings() { |
395 | 396 | |
396 | 397 | <p class="auto-update-status"> |
397 | 398 | <?php |
398 | | if ( $upgrade_major ) { |
| 399 | $updater = new WP_Automatic_Updater(); |
| 400 | if ( $updater->is_vcs_checkout( ABSPATH ) ) { |
| 401 | _e( 'The WordPress installation on this site appears to be under version control. Automatic updates are disabled.' ); |
| 402 | } elseif ( $upgrade_major ) { |
399 | 403 | _e( 'This site is automatically kept up to date with each new version of WordPress.' ); |
400 | 404 | |
401 | 405 | if ( $can_set_update_option ) { |
402 | 406 | echo '<br>'; |
403 | 407 | printf( |
404 | | '<a href="%s">%s</a>', |
| 408 | '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-disable">%s</a>', |
405 | 409 | wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ), |
406 | 410 | __( 'Switch to automatic updates for maintenance and security releases only.' ) |
407 | 411 | ); |
408 | 412 | } |
409 | 413 | } elseif ( $upgrade_minor ) { |
410 | | _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress.' ); |
| 414 | _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' ); |
411 | 415 | |
412 | 416 | if ( $can_set_update_option ) { |
413 | 417 | echo '<br>'; |
414 | 418 | printf( |
415 | | '<a href="%s">%s</a>', |
| 419 | '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-enable">%s</a>', |
416 | 420 | wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ), |
417 | 421 | __( 'Enable automatic updates for all new versions of WordPress.' ) |
418 | 422 | ); |