I have created a menu which have several items (WooCommerce categories), each of them having few child items (WooCommerce products).
I'm struggling to retrieve the sub items of a parent menu item.
Im getting the parent item using this code:
$the_menu = wp_get_nav_menu_object('Some Menu');
$the_menu_items = wp_get_nav_menu_items($the_menu);
foreach ($the_menu_items as $index => $menu_item) {
if ($menu_item->object_id == $category->term_id ) {
$category_submenu = $menu_item;
}
}
How can I retrieve the child items of current parent item?
Thank you in advance!