Make WordPress Core

Ticket #51742: 51742.14.diff

File 51742.14.diff, 3.4 KB (added by pbiron, 14 months ago)
  • src/wp-admin/update-core.php

    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 ) { 
    6262        $show_buttons  = true;
    6363
    6464        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:' );
    6666        } else {
    6767                if ( $current ) {
    6868                        /* translators: %s: WordPress version. */
    function core_upgrade_preamble() { 
    278278                }
    279279        }
    280280
     281        echo '<h2>' . __( 'You are using a development version of WordPress' ) . '</h2>';
    281282        echo '<ul class="core-updates">';
    282283        foreach ( (array) $updates as $update ) {
    283284                echo '<li>';
    function core_auto_updates_settings() { 
    311312                        $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' );
    312313                        echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
    313314                } 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.' );
    315316                        echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
    316317                }
    317318        }
    function core_auto_updates_settings() { 
    395396
    396397        <p class="auto-update-status">
    397398                <?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 ) {
    399403                        _e( 'This site is automatically kept up to date with each new version of WordPress.' );
    400404
    401405                        if ( $can_set_update_option ) {
    402406                                echo '<br>';
    403407                                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>',
    405409                                        wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ),
    406410                                        __( 'Switch to automatic updates for maintenance and security releases only.' )
    407411                                );
    408412                        }
    409413                } 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.' );
    411415
    412416                        if ( $can_set_update_option ) {
    413417                                echo '<br>';
    414418                                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>',
    416420                                        wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ),
    417421                                        __( 'Enable automatic updates for all new versions of WordPress.' )
    418422                                );