WordPress.org

Make WordPress Core

Changeset 50506 for trunk


Ignore:
Timestamp:
03/08/2021 11:29:37 AM (11 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Display version number on the "Update now" button on WordPress Updates screen.

Additionally, adjust the "Update to latest nightly" button to include the major version number of the nightly build.

This makes the button labels more accurate and provides more clear understanding of what the update will be.

Follow-up to [49984].

Props afragen, pbiron, SergeyBiryukov.
Fixes #52513.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r50082 r50506  
    5656    }
    5757
    58     $is_development_version = preg_match( '/alpha|beta|RC/', $version_string );
    59 
    6058    $message       = '';
    61     $submit        = $is_development_version ? __( 'Update to latest nightly' ) : __( 'Update now' );
    6259    $form_action   = 'update-core.php?action=do-core-upgrade';
    6360    $php_version   = phpversion();
    6461    $mysql_version = $wpdb->db_version();
    6562    $show_buttons  = true;
     63
     64    // Nightly build versions have two hyphens and a commit number.
     65    if ( preg_match( '/-\w+-\d+/', $update->current ) ) {
     66        // Retrieve the major version number.
     67        preg_match( '/^\d+.\d+/', $update->current, $update_major );
     68        /* translators: %s: WordPress version. */
     69        $submit = sprintf( __( 'Update to latest %s nightly' ), $update_major[0] );
     70    } else {
     71        /* translators: %s: WordPress version. */
     72        $submit = sprintf( __( 'Update to version %s' ), $version_string );
     73    }
    6674
    6775    if ( 'development' === $update->response ) {
Note: See TracChangeset for help on using the changeset viewer.