Make WordPress Core

Ticket #52513: 52513.diff

File 52513.diff, 1.2 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-admin/update-core.php

     
    5555                $current = true;
    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;
    6663
     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        }
     74
    6775        if ( 'development' === $update->response ) {
    6876                $message = __( 'You can update to the latest nightly build manually:' );
    6977        } else {