0

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?

0

Try giving menu-item-status as draft instead of publish

  • Please back your answers with good amount of reasons and explanations. – Maruti Mohanty Dec 2 '13 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.