[2.4] Fix notice in wc_nav_menu_items when endpoint is not set
Fixes #9216
This commit is contained in:
parent
786c87523f
commit
4747e097e2
|
@ -163,12 +163,14 @@ function wc_nav_menu_items( $items ) {
|
|||
if ( ! is_user_logged_in() ) {
|
||||
$customer_logout = get_option( 'woocommerce_logout_endpoint', 'customer-logout' );
|
||||
|
||||
if ( ! empty( $customer_logout ) ) {
|
||||
foreach ( $items as $key => $item ) {
|
||||
if ( strstr( $item->url, $customer_logout ) ) {
|
||||
unset( $items[ $key ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue