Make WordPress Core


Ignore:
Timestamp:
07/30/2026 02:54:34 PM (2 months ago)
Author:
afercia
Message:

Administration: Fix the alignment of the 'Update to' button in the 'At a Glance' Dashboard widget.

Updates the CSS for the 'At a Glance' dashboard widget to use a flexbox layout so the Core update button stays within the widget container and better aligns to the version text.

Also, fixes the DOM order and the visual order so that they match.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12715

Props khokansardar, joedolson, afercia.
Fixes #65733.

File:
1 edited

Legend:

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

    r61594 r62943  
    363363        }
    364364
    365         $msg = '';
    366 
    367         if ( current_user_can( 'update_core' ) ) {
    368                 $cur = get_preferred_from_update_core();
    369 
    370                 if ( isset( $cur->response ) && 'upgrade' === $cur->response ) {
    371                         $msg .= sprintf(
    372                                 '<a href="%s" class="button" aria-describedby="wp-version">%s</a> ',
    373                                 network_admin_url( 'update-core.php' ),
    374                                 /* translators: %s: WordPress version number, or 'Latest' string. */
    375                                 sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) )
    376                         );
    377                 }
    378         }
    379 
    380365        /* translators: 1: Version number, 2: Theme name. */
    381366        $content = __( 'WordPress %1$s running %2$s theme.' );
    … …  
    392377        $content = apply_filters( 'update_right_now_text', $content );
    393378
    394         $msg .= sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );
     379        $msg = sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );
     380
     381        if ( current_user_can( 'update_core' ) ) {
     382                $cur = get_preferred_from_update_core();
     383
     384                if ( isset( $cur->response ) && 'upgrade' === $cur->response ) {
     385                        $msg .= sprintf(
     386                                '<a href="%s" class="button" aria-describedby="wp-version">%s</a>',
     387                                network_admin_url( 'update-core.php' ),
     388                                /* translators: %s: WordPress version number, or 'Latest' string. */
     389                                sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) )
     390                        );
     391                }
     392        }
    395393
    396394        echo "<p id='wp-version-message'>$msg</p>";
Note: See TracChangeset for help on using the changeset viewer.