From 1393ebd06c8b956c414ed3dc4c222d6f92fd6e1b Mon Sep 17 00:00:00 2001 From: Barry Ceelen Date: Tue, 21 Jun 2022 04:04:59 +0200 Subject: [PATCH] Remove tax query before fetching nav menu items WordPress 6.0 refactors the query in `wp_get_nav_menu_items()` to [use a tax_query](https://github.com/WordPress/wordpress-develop/pull/2399/files#diff-1b01be7c995419a8307dd2b2c8e1b4fc96e75ef07df4e8e66c45cc8273d02e0fR708). The `navception()` filter however passes along the original $args, including the tax query, when fetching menu items, causing an infinite loop. This update removes the `$args['tax_query']` key before passing it along to `wp_get_nav_menu_items()`. --- navception.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/navception.php b/navception.php index f0b8f9d..3f404c9 100644 --- a/navception.php +++ b/navception.php @@ -126,6 +126,8 @@ public function navception( $items, $menu, $args ) { } else { $args['navception_previous_menu_item_parent'] = $previous_menu_item_parent; } + + unset( $args['tax_query'] ); $navception_items = wp_get_nav_menu_items( $item->object_id, $args );