Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
This commit is contained in:
parent
9c58f198cf
commit
ad2d18200f
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: enhancement
|
||||
|
||||
Add additional body class for the account dashboard
|
|
@ -299,6 +299,9 @@ function wc_generator_tag( $gen, $type ) {
|
|||
* @return array
|
||||
*/
|
||||
function wc_body_class( $classes ) {
|
||||
|
||||
global $wp;
|
||||
|
||||
$classes = (array) $classes;
|
||||
|
||||
if ( is_shop() ) {
|
||||
|
@ -327,6 +330,11 @@ function wc_body_class( $classes ) {
|
|||
$classes[] = 'woocommerce-account';
|
||||
$classes[] = 'woocommerce-page';
|
||||
|
||||
$account_page_id = get_option( 'woocommerce_myaccount_page_id' );
|
||||
|
||||
if ( ! empty( $account_page_id ) && ( get_post_field( 'post_name', $account_page_id ) === basename( $wp->request ) && is_user_logged_in() ) ) {
|
||||
$classes[] = 'woocommerce-dashboard';
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_store_notice_showing() ) {
|
||||
|
|
Loading…
Reference in New Issue