Reintroduce JITMs in the WC Admin. (#34383)

* Add JITMs

* Fix styles

* Remove styles

* Add changelog.

* Add notice-list div

* Move hidden jitm style

* Move hidden jitm style

* Fix style

* Fix `margin-right`

* Remove `important`

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
AnnaMag 2022-09-14 18:05:54 +02:00 committed by GitHub
parent 012a8b4655
commit 01925e61e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View File

@ -46,6 +46,17 @@
background: $gray-0;
}
}
/**
* JITM specific styles
*/
&__jitm {
.jitm-card {
margin: 3rem 1.25rem 1.25rem;
}
}
&__jitm-hide {
display: none;
}
}
body.woocommerce-page {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Re-enable JITMs in the WC Admin.

View File

@ -230,6 +230,12 @@ class Loader {
return;
}
// The JITMs won't be shown in the Onboarding Wizard.
$is_onboarding = isset( $_GET['path'] ) && '/setup-wizard' === wc_clean( wp_unslash( $_GET['path'] ) ); // phpcs:ignore WordPress.Security.NonceVerification
$maybe_hide_jitm = $is_onboarding ? '-hide' : '';
echo '<div class="woocommerce-layout__jitm' . sanitize_html_class( $maybe_hide_jitm ) . '" id="jp-admin-notices"></div>';
// Wrap the notices in a hidden div to prevent flickering before
// they are moved elsewhere in the page by WordPress Core.
echo '<div class="woocommerce-layout__notice-list-hide" id="wp__notice-list">';