Dynamically add sub menu items


I have been able to add menu items with this statement, this however creates a flat menu. The menu has been created already. I just need to add items.

    wp_update_nav_menu_item(4, 0, array('menu-item-title' =>  __($post_title), 'menu-item-url' => home_url('/'.$url.'/'), 'menu-item-status' => 'publish'));

this is super simple to use. How do I add a sub-menu item?

blenkhn 1 year 0 Answers 64 views 0

Leave an answer