我尝试在wordpress上以编程方式添加一个新的函数:
wp_update_nav_menu_item($menu, 0, array(\'menu-item-title\' => $title,
\'menu-item-object\' => \'page\',
\'menu-item-object-id\' => $post_id,
\'menu-item-type\' => \'post_type\',
\'menu-item-status\' => \'publish\', // is there any \'delete\', \'unpublish\' ??
\'menu-item-parent-id\' => $parent
));
当我创建一个页面,但我想更改父页面或只是更新页面时,此功能会在菜单中再次添加页面。我想知道是否有办法从dhe菜单中删除或更新菜单项?