WordPress.org

Make WordPress Core

Changeset 49712


Ignore:
Timestamp:
11/30/2020 04:51:15 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Display "You are using a development version" message on WordPress Updates screen for Beta or RC versions.

This ensures that the message is displayed when the WP_AUTO_UPDATE_CORE constant is set to beta or rc and the user is on a development version.

Follow-up to [49245], [49254], [49292], [49638], [49708].

Props afragen, audrasjb, azaozz, SergeyBiryukov.
Reviewed by azaozz, SergeyBiryukov.
Merges [49709] and [49668] to the 5.6 branch.
Fixes #51822.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/src/wp-admin/update-core.php

    r49682 r49712  
    230230    global $required_php_version, $required_mysql_version;
    231231
    232     $wp_version = get_bloginfo( 'version' );
    233     $updates    = get_core_updates();
    234 
    235     if ( isset( $updates[0] ) && isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
     232    $updates = get_core_updates();
     233
     234    // Include an unmodified $wp_version.
     235    require ABSPATH . WPINC . '/version.php';
     236
     237    $is_development_version = preg_match( '/alpha|beta|RC/', $wp_version );
     238
     239    if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
    236240        echo '<h2 class="response">';
    237241        _e( 'An updated version of WordPress is available.' );
     
    246250        );
    247251        echo '</p></div>';
    248     } elseif ( isset( $updates[0] ) && 'development' === $updates[0]->response ) {
     252    } elseif ( $is_development_version ) {
    249253        echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>';
    250254    } else {
     
    259263    }
    260264    echo '</ul>';
     265
    261266    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    262267    if ( $updates && ( count( $updates ) > 1 || 'latest' !== $updates[0]->response ) ) {
     
    271276        ) . '</p>';
    272277    }
     278
    273279    dismissed_updates();
    274280}
Note: See TracChangeset for help on using the changeset viewer.