From 6eb2cd991bbdeb51216f889d1c1a5f60d809618b Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Wed, 11 Sep 2024 09:04:40 +0200 Subject: [PATCH] Small code refactor --- .../woocommerce/includes/wc-template-functions.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce/includes/wc-template-functions.php b/plugins/woocommerce/includes/wc-template-functions.php index 99fc3318053..10a4ebdc563 100644 --- a/plugins/woocommerce/includes/wc-template-functions.php +++ b/plugins/woocommerce/includes/wc-template-functions.php @@ -332,16 +332,9 @@ function wc_body_class( $classes ) { $account_page_id = get_option( 'woocommerce_myaccount_page_id' ); - if ( !empty( $account_page_id ) ) { - - if ( get_post_field( 'post_name', $account_page_id ) == basename( $wp->request ) && is_user_logged_in() ) { - - $classes[] = 'woocommerce-dashboard'; - - } - + 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() ) {