Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

share|improve this answer
    
Please back your answers with good amount of reasons and explanations. –  Maruti Mohanty Dec 2 '13 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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