From 15d4c97f1ed9f10993f2ae05d170eba65163942c Mon Sep 17 00:00:00 2001 From: "Marius L. J" Date: Sun, 27 Jun 2021 15:55:21 +0000 Subject: [PATCH] Site Health: Add a unique wrapper for dashboard widget content. This wraps the inner-content of the Site Health dashboard widget to give a unique target for CSS selectors, restoring the ability to collapse the widget. The initial implementation targeted the `.inside` class used by all widgets to apply styling to the widget content, but this prevented the widget from being collapsed, as it added grid-styles which other widgets do not use, overriding the usual behavior when toggling widget visibility. Follow-up to [50833]. Props alanjacobmathew, walbo. Fixes #53521. git-svn-id: https://develop.svn.wordpress.org/trunk@51247 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/site-health.css | 4 +- src/wp-admin/includes/dashboard.php | 110 ++++++++++++++-------------- 2 files changed, 58 insertions(+), 56 deletions(-) diff --git a/src/wp-admin/css/site-health.css b/src/wp-admin/css/site-health.css index 9fb3c95181..8c16d4b4a0 100644 --- a/src/wp-admin/css/site-health.css +++ b/src/wp-admin/css/site-health.css @@ -306,7 +306,7 @@ are styled in the Privacy section of edit.css */ padding-left: 16px; } -#dashboard_site_health .inside { +#dashboard_site_health .health-check-widget { display: grid; grid-template-columns: 1fr 2fr; grid-auto-rows: minmax(64px, auto); @@ -318,7 +318,7 @@ are styled in the Privacy section of edit.css */ } @media screen and (max-width: 480px) { - #dashboard_site_health .inside { + #dashboard_site_health .health-check-widget { grid-template-columns: 100%; } } diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 45dddd81a6..b7ee472724 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -1909,67 +1909,69 @@ function wp_dashboard_site_health() { $issues_total = $issue_counts['recommended'] + $issue_counts['critical']; ?> -
-
- +
+
+
+ +
+
+ + + + + +
-
+ +
- +

+ visit the Site Health screen to gather information about your site now.' ), + esc_url( admin_url( 'site-health.php' ) ) + ); + ?> +

- +

+ + + + + 1 ) : ?> + + + + + + +

+ + + 0 && false !== $get_issues ) : ?> +

+ %1$d item on the Site Health screen.', + 'Take a look at the %1$d items on the Site Health screen.', + $issues_total + ), + $issues_total, + esc_url( admin_url( 'site-health.php' ) ) + ); + ?> +

-
- -

- visit the Site Health screen to gather information about your site now.' ), - esc_url( admin_url( 'site-health.php' ) ) - ); - ?> -

- -

- - - - - 1 ) : ?> - - - - - - -

- - - 0 && false !== $get_issues ) : ?> -

- %1$d item on the Site Health screen.', - 'Take a look at the %1$d items on the Site Health screen.', - $issues_total - ), - $issues_total, - esc_url( admin_url( 'site-health.php' ) ) - ); - ?> -

- -
-