Added is-active class to Orders when looking at individual order under My Account.
This commit is contained in:
parent
f757c6c60d
commit
36d2c96faa
|
@ -149,6 +149,8 @@ function wc_get_account_menu_item_classes( $endpoint ) {
|
||||||
$current = isset( $wp->query_vars[ $endpoint ] );
|
$current = isset( $wp->query_vars[ $endpoint ] );
|
||||||
if ( 'dashboard' === $endpoint && ( isset( $wp->query_vars['page'] ) || empty( $wp->query_vars ) ) ) {
|
if ( 'dashboard' === $endpoint && ( isset( $wp->query_vars['page'] ) || empty( $wp->query_vars ) ) ) {
|
||||||
$current = true; // Dashboard is not an endpoint, so needs a custom check.
|
$current = true; // Dashboard is not an endpoint, so needs a custom check.
|
||||||
|
} elseif ( 'orders' === $endpoint && isset( $wp->query_vars['view-order'] ) ) {
|
||||||
|
$current = true; // When looking at individual order, highlight Orders list item (to signify where in the menu the user currently is).
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $current ) {
|
if ( $current ) {
|
||||||
|
|
Loading…
Reference in New Issue