admin管理员组文章数量:1389889
I've tried adding a new programmatically on wordpress with the function:
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
));
This works when I create a page but I want to change the parent or just update the page this function adds the page again in the menu.I want to know if there is a way I can delete or update the menu item from dhe menu?
I've tried adding a new programmatically on wordpress with the function:
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
));
This works when I create a page but I want to change the parent or just update the page this function adds the page again in the menu.I want to know if there is a way I can delete or update the menu item from dhe menu?
Share Improve this question asked Oct 7, 2013 at 14:54 Antonio PapaAntonio Papa 1331 silver badge10 bronze badges1 Answer
Reset to default 0Try giving menu-item-status as draft instead of publish
本文标签: navigationUpdate nav menu item position programmatically
版权声明:本文标题:navigation - Update nav menu item position programmatically 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744648006a2617514.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论