Changeset 54165
- Timestamp:
- 09/14/2022 09:12:12 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/site-health.js
r54089 r54165 16 16 isDebugTab = $( '.health-check-body.health-check-debug-tab' ).length, 17 17 pathsSizesSection = $( '#health-check-accordion-block-wp-paths-sizes' ), 18 menuCounterWrapper = $( '#adminmenu .site-health-counter' ), 19 menuCounter = $( '#adminmenu .site-health-counter .count' ), 18 20 successTimeout; 19 21 … … 165 167 } 166 168 169 menuCounter.text( SiteHealth.site_status.issues.critical ); 170 167 171 if ( 0 < parseInt( SiteHealth.site_status.issues.critical, 0 ) ) { 168 172 $( '#health-check-issues-critical' ).removeClass( 'hidden' ); 173 174 menuCounterWrapper.removeClass( 'count-0' ); 175 } else { 176 menuCounterWrapper.addClass( 'count-0' ); 169 177 } 170 178 if ( 0 < parseInt( SiteHealth.site_status.issues.recommended, 0 ) ) { -
trunk/src/wp-admin/css/admin-menu.css
r53731 r54165 428 428 429 429 /* @todo: consider to use a single rule for these counters and the list table comments counters. */ 430 #adminmenu .menu-counter, 430 431 #adminmenu .awaiting-mod, 431 432 #adminmenu .update-plugins { -
trunk/src/wp-admin/css/colors/_admin.scss
r53383 r54165 351 351 /* Admin Menu: bubble */ 352 352 353 #adminmenu .menu-counter, 353 354 #adminmenu .awaiting-mod, 354 355 #adminmenu .update-plugins { -
trunk/src/wp-admin/menu.php
r52415 r54165 343 343 } 344 344 345 $site_health_count = ''; 346 if ( ! is_multisite() && current_user_can( 'view_site_health_checks' ) ) { 347 $get_issues = get_transient( 'health-check-site-status-result' ); 348 349 $issue_counts = array(); 350 351 if ( false !== $get_issues ) { 352 $issue_counts = json_decode( $get_issues, true ); 353 } 354 355 if ( ! is_array( $issue_counts ) || ! $issue_counts ) { 356 $issue_counts = array( 357 'good' => 0, 358 'recommended' => 0, 359 'critical' => 0, 360 ); 361 } 362 363 $site_health_count = sprintf( 364 '<span class="menu-counter site-health-counter count-%s"><span class="count">%s</span></span>', 365 $issue_counts['critical'], 366 number_format_i18n( $issue_counts['critical'] ) 367 ); 368 } 369 345 370 $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); 346 371 $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' ); 347 372 $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' ); 348 373 $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' ); 349 $submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' ); 374 /* translators: %s: Number of critical Site Health checks. */ 375 $submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' ); 350 376 $submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' ); 351 377 $submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );
Note: See TracChangeset
for help on using the changeset viewer.