WordPress.org

Make WordPress Core

Ticket #51774: 51774.6.diff

File 51774.6.diff, 1.6 KB (added by afragen, 10 months ago)

simplify preg_match()

  • wp-admin/update-core.php

    diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php
    index 3beb87b6ed..52f5feb42e 100644
    a b function list_core_update( $update ) { 
    3838        static $first_pass = true;
    3939
    4040        $wp_version     = get_bloginfo( 'version' );
    41         $version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );
     41        $version_string = sprintf( '%s&ndash;%s', $update->current, get_locale() );
    4242
    4343        if ( 'en_US' === $update->locale && 'en_US' === get_locale() ) {
    4444                $version_string = $update->current;
    function list_core_update( $update ) { 
    5555                $current = true;
    5656        }
    5757
    58         $submit        = __( 'Update Now' );
     58        $development   = preg_match( '/alpha|beta|RC/', $version_string );
     59        $submit        = $development ? __( 'Update to latest nightly' ) : __( 'Update Now' );
    5960        $form_action   = 'update-core.php?action=do-core-upgrade';
    6061        $php_version   = phpversion();
    6162        $mysql_version = $wpdb->db_version();
    function list_core_update( $update ) { 
    6566                $message = __( 'You can update to the latest nightly build manually:' );
    6667        } else {
    6768                if ( $current ) {
     69                        $message = '';
    6870                        /* translators: %s: WordPress version. */
    69                         $message     = sprintf( __( 'If you need to re-install version %s, you can do so here:' ), $version_string );
    70                         $submit      = __( 'Re-install Now' );
     71                        $submit      = sprintf( __( 'Re-install version %s' ), $version_string );
    7172                        $form_action = 'update-core.php?action=do-core-reinstall';
    7273                } else {
    7374                        $php_compat = version_compare( $php_version, $update->php_version, '>=' );