diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index 76270ae0d3fe5..70a1c8dbf34af 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -335,7 +335,7 @@ .welcome-panel .welcome-icon:before, #dashboard_right_now li a:before, #dashboard_right_now li span:before, -#dashboard_right_now .search-engines-info:before { +#dashboard_right_now .search-engines-info a:before { color: #646970; font: normal 20px/1 dashicons; speak: never; @@ -410,38 +410,12 @@ #dashboard_right_now .search-engines-info:before, #dashboard_right_now li a:before, #dashboard_right_now li > span:before { /* get only the first level span to exclude screen-reader-text in mu-storage */ - content: "\f159"; /* generic icon for items added by CPTs ? */ padding: 0 5px 0 0; } -#dashboard_right_now .page-count a:before, -#dashboard_right_now .page-count span:before { - content: "\f105"; -} - -#dashboard_right_now .post-count a:before, -#dashboard_right_now .post-count span:before { - content: "\f109"; -} - -#dashboard_right_now .comment-count a:before { - content: "\f101"; -} - -#dashboard_right_now .comment-mod-count a:before { - content: "\f125"; -} - -#dashboard_right_now .storage-count a:before { - content: "\f104"; -} - -#dashboard_right_now .storage-count.warning a:before { - content: "\f153"; -} - -#dashboard_right_now .search-engines-info:before { - content: "\f348"; +#dashboard_right_now li a:not(.dashicons-before):before, +#dashboard_right_now li > span:not(.dashicons-before):before { /* get only the first level span to exclude screen-reader-text in mu-storage */ + content: "\f159"; /* generic icon for items added by CPTs ? */ } /* Dashboard WordPress events */ diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index ea870a1f5b1ee..f2fffb17853c0 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -317,11 +317,12 @@ function wp_dashboard_right_now() { $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); $post_type_object = get_post_type_object( $post_type ); + $icon_class = 'dashicons-before dashicons-admin-' . $post_type; if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) { - printf( '
  • %2$s
  • ', $post_type, $text ); + printf( '
  • %2$s
  • ', $post_type, $text, esc_attr( $icon_class ) ); } else { - printf( '
  • %2$s
  • ', $post_type, $text ); + printf( '
  • %2$s
  • ', $post_type, $text, esc_attr( $icon_class ) ); } } } @@ -334,7 +335,7 @@ function wp_dashboard_right_now() { $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) ); ?>
  • - +
  • moderated ); @@ -342,7 +343,7 @@ function wp_dashboard_right_now() { $text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n ); ?>
  • - +
  • $content

    "; + echo '

    ' . $content . '

    '; } ?> @@ -1652,9 +1654,11 @@ function wp_dashboard_quota() { $percentused = ( $used / $quota ) * 100; } - $used_class = ( $percentused >= 70 ) ? ' warning' : ''; - $used = round( $used, 2 ); - $percentused = number_format( $percentused ); + $used_class = ( $percentused >= 70 ) ? ' warning' : ''; + $icon_class = ( $percentused >= 70 ) ? ' dashicons-dismiss' : 'dashicons-admin-media'; + $icon_class .= ' dashicons-before'; + $used = round( $used, 2 ); + $percentused = number_format( $percentused ); ?>

    @@ -1668,27 +1672,30 @@ function wp_dashboard_quota() { number_format_i18n( $quota ) ); printf( - '%2$s (%3$s)', + '%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, /* translators: Hidden accessibility text. */ - __( 'Manage Uploads' ) + __( 'Manage Uploads' ), + esc_attr( $icon_class ) ); ?>
  • %2$s (%3$s)', + '%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, /* translators: Hidden accessibility text. */ - __( 'Manage Uploads' ) + __( 'Manage Uploads' ), + esc_attr( $icon_class ) ); ?>