Wp menu item (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
$ wp help menu item

NAME

  wp menu item

DESCRIPTION

  List, add, and delete items associated with a menu.

SYNOPSIS

  wp menu item <command>

SUBCOMMANDS

  add-custom      Adds a custom menu item.
  add-post        Adds a post as a menu item.
  add-term        Adds a taxonomy term as a menu item.
  delete          Deletes one or more items from a menu.
  list            Gets a list of items associated with a menu.
  update          Updates a menu item.

EXAMPLES

    # Add an existing post to an existing menu
    $ wp menu item add-post sidebar-menu 33 --title="Custom Test Post"
    Success: Menu item added.

    # Create a new menu link item
    $ wp menu item add-custom sidebar-menu Apple http://apple.com
    Success: Menu item added.

    # Delete menu item
    $ wp menu item delete 45
    Success: 1 menu item deleted.