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:
parent
012a8b4655
commit
01925e61e3
|
@ -46,6 +46,17 @@
|
||||||
background: $gray-0;
|
background: $gray-0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* JITM specific styles
|
||||||
|
*/
|
||||||
|
&__jitm {
|
||||||
|
.jitm-card {
|
||||||
|
margin: 3rem 1.25rem 1.25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__jitm-hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body.woocommerce-page {
|
body.woocommerce-page {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Re-enable JITMs in the WC Admin.
|
|
@ -230,6 +230,12 @@ class Loader {
|
||||||
return;
|
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
|
// Wrap the notices in a hidden div to prevent flickering before
|
||||||
// they are moved elsewhere in the page by WordPress Core.
|
// they are moved elsewhere in the page by WordPress Core.
|
||||||
echo '<div class="woocommerce-layout__notice-list-hide" id="wp__notice-list">';
|
echo '<div class="woocommerce-layout__notice-list-hide" id="wp__notice-list">';
|
||||||
|
|
Loading…
Reference in New Issue