-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
bugcommand:menu-itemRelated to 'menu item' commandRelated to 'menu item' commandcommand:menu-item-add-customRelated to 'menu item add-custom' commandRelated to 'menu item add-custom' command
Description
$ wp menu item add … takes the --position argument literally and inserts it into the database exactly as specified. This is a problem when you are trying to insert one menu item between two others.
For example, on a site that already has a handful of menu links (one of which is in position 3), let's add an item like so:
$ wp menu item add-post example-menu 123 --position=3
In the wp_posts table, the two menu links will have the same menu_order value. This creates mixed results on the frontend of WordPress.
Now, if I go to the menu manager in WordPress and click Save Menu, WordPress recalculates and updates the duplicate menu_order values.
Can WP-CLI do what WordPress is doing here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcommand:menu-itemRelated to 'menu item' commandRelated to 'menu item' commandcommand:menu-item-add-customRelated to 'menu item add-custom' commandRelated to 'menu item add-custom' command