[2.4] Fix notice in wc_nav_menu_items when endpoint is not set

Fixes #9216
This commit is contained in:
Mike Jolley 2015-10-02 10:04:18 +02:00
parent 786c87523f
commit 4747e097e2
1 changed files with 5 additions and 3 deletions

View File

@ -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;
}