From 4f9b7759ad1a1cca502b3a0917a34683dd1e3adc Mon Sep 17 00:00:00 2001 From: Suryakant Upadhyay Date: Tue, 20 Oct 2026 18:32:42 +0530 Subject: [PATCH 1/2] Administration: Use SVG icons in the At a Glance dashboard widget. Use registered core icons and preserve them when comment counts update via AJAX. See https://core.trac.wordpress.org/ticket/66347. --- src/js/_enqueues/admin/edit-comments.js | 2 +- src/wp-admin/css/dashboard.css | 41 ++++++------------------- src/wp-admin/includes/dashboard.php | 22 +++++++------ 3 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/js/_enqueues/admin/edit-comments.js b/src/js/_enqueues/admin/edit-comments.js index 7e89f1c0dd7cb..a8c869f6d33dc 100644 --- a/src/js/_enqueues/admin/edit-comments.js +++ b/src/js/_enqueues/admin/edit-comments.js @@ -152,7 +152,7 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved, return; } - $( '.comment-count a', '#dashboard_right_now' ).text( response.i18n_comments_text ); + $( '.comment-count .comments-count-text', '#dashboard_right_now' ).text( response.i18n_comments_text ); }; /** diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index a79960cb39419..779f93f23304d 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -442,41 +442,20 @@ content: "\f159" / ""; } -#dashboard_right_now .page-count a::before, -#dashboard_right_now .page-count span::before { - content: "\f105"; - content: "\f105" / ""; -} - -#dashboard_right_now .post-count a::before, -#dashboard_right_now .post-count span::before { - content: "\f109"; - content: "\f109" / ""; -} - -#dashboard_right_now .comment-count a::before { - content: "\f101"; - content: "\f101" / ""; -} - -#dashboard_right_now .comment-mod-count a::before { - content: "\f125"; - content: "\f125" / ""; -} - -#dashboard_right_now .storage-count a::before { - content: "\f104"; - content: "\f104" / ""; +#dashboard_right_now li .glance-item::before, +#dashboard_right_now .search-engines-info::before { + display: none; } -#dashboard_right_now .storage-count.warning a::before { - content: "\f153"; - content: "\f153" / ""; +#dashboard_right_now .glance-item svg { + fill: currentColor; + color: #646970; + margin-right: 5px; + vertical-align: top; } -#dashboard_right_now .search-engines-info::before { - content: "\f348"; - content: "\f348" / ""; +#dashboard_right_now .warning .glance-item svg, +#dashboard_right_now .search-engines-info svg { color: #d63638; } diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 165b556f9eb85..645e73c77ee7d 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -349,6 +349,7 @@ function wp_dashboard_right_now() { $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); $post_type_object = get_post_type_object( $post_type ); + $icon = wp_get_icon( 'post' === $post_type ? 'core-admin/pin' : 'core-admin/page', array( 'size' => 20 ) ); if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) { $url = add_query_arg( @@ -358,9 +359,9 @@ function wp_dashboard_right_now() { ), admin_url( 'edit.php' ) ); - printf( '
  • %3$s
  • ', $post_type, esc_url( $url ), esc_html( $text ) ); + printf( '
  • %3$s%4$s
  • ', $post_type, esc_url( $url ), $icon, esc_html( $text ) ); } else { - printf( '
  • %2$s
  • ', $post_type, $text ); + printf( '
  • %2$s%3$s
  • ', $post_type, $icon, esc_html( $text ) ); } } } @@ -373,7 +374,7 @@ function wp_dashboard_right_now() { $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) ); ?>
  • - + 20 ) ); ?>
  • moderated ); @@ -381,7 +382,7 @@ function wp_dashboard_right_now() { $text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n ); ?>
  • - + 20 ) ); ?>
  • $content

    "; + $icon = wp_get_icon( 'core/caution', array( 'size' => 20 ) ); + echo "

    $icon$content

    "; } ?> @@ -1921,11 +1923,12 @@ function wp_dashboard_quota() { number_format_i18n( $quota ) ); printf( - '%2$s (%3$s)', + '%4$s%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, /* translators: Hidden accessibility text. */ - __( 'Manage Uploads' ) + __( 'Manage Uploads' ), + wp_get_icon( 'core/upload', array( 'size' => 20 ) ) ); ?>
  • @@ -1937,11 +1940,12 @@ function wp_dashboard_quota() { $percentused ); printf( - '%2$s (%3$s)', + '%4$s%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, /* translators: Hidden accessibility text. */ - __( 'Manage Uploads' ) + __( 'Manage Uploads' ), + wp_get_icon( $used_class ? 'core/caution' : 'core/upload', array( 'size' => 20 ) ) ); ?>
  • From c6a0037fb2723da476e129268ad008d4914e0baa Mon Sep 17 00:00:00 2001 From: Suryakant Upadhyay Date: Tue, 20 Oct 2026 19:40:45 +0530 Subject: [PATCH 2/2] fix: align dashboard glance icons and text with consistent spacing --- src/wp-admin/css/dashboard.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index 779f93f23304d..18e86b61e05c0 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -447,11 +447,16 @@ display: none; } +#dashboard_right_now .glance-item { + display: inline-flex; + align-items: center; + gap: 5px; +} + #dashboard_right_now .glance-item svg { + flex: none; fill: currentColor; color: #646970; - margin-right: 5px; - vertical-align: top; } #dashboard_right_now .warning .glance-item svg,