diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index 1f1207606439e..bfa07cce205c9 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -724,11 +724,19 @@ body #dashboard-widgets .postbox form .submit { margin: 0; } +#dashboard_right_now #wp-version-message { + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: 5px; +} + +#dashboard_right_now #wp-version { + flex: 1; +} + #dashboard_right_now #wp-version-message .button { - float: right; - position: relative; - top: -5px; - margin-left: 5px; + margin-left: auto; } #dashboard_right_now p.search-engines-info { diff --git a/src/wp-admin/includes/update.php b/src/wp-admin/includes/update.php index f5aeea835bd12..7d85e05b3c24a 100644 --- a/src/wp-admin/includes/update.php +++ b/src/wp-admin/includes/update.php @@ -362,21 +362,6 @@ function update_right_now_message() { $theme_name = sprintf( '%1$s', $theme_name ); } - $msg = ''; - - if ( current_user_can( 'update_core' ) ) { - $cur = get_preferred_from_update_core(); - - if ( isset( $cur->response ) && 'upgrade' === $cur->response ) { - $msg .= sprintf( - '%s ', - network_admin_url( 'update-core.php' ), - /* translators: %s: WordPress version number, or 'Latest' string. */ - sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) - ); - } - } - /* translators: 1: Version number, 2: Theme name. */ $content = __( 'WordPress %1$s running %2$s theme.' ); @@ -391,7 +376,20 @@ function update_right_now_message() { */ $content = apply_filters( 'update_right_now_text', $content ); - $msg .= sprintf( '' . $content . '', get_bloginfo( 'version', 'display' ), $theme_name ); + $msg = sprintf( '' . $content . '', get_bloginfo( 'version', 'display' ), $theme_name ); + + if ( current_user_can( 'update_core' ) ) { + $cur = get_preferred_from_update_core(); + + if ( isset( $cur->response ) && 'upgrade' === $cur->response ) { + $msg .= sprintf( + ' %s', + network_admin_url( 'update-core.php' ), + /* translators: %s: WordPress version number, or 'Latest' string. */ + sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) + ); + } + } echo "
$msg
"; }