Skip to content

Position is not updated in wp menu item update command #463

@ernilambar

Description

@ernilambar

Bug Report

Describe the current, buggy behavior

Position is not updated in wp menu item update command.

Describe how other contributors can replicate this bug

wp menu create "Sample Menu"
wp menu item add-custom sample-menu Alpha https://alpha.com
wp menu item add-custom sample-menu Beta https://beta.com

wp menu item list sample-menu --format=csv

db_id,type,title,link,position
1272,custom,Alpha,https://alpha.com,1
1273,custom,Beta,https://beta.com,2

wp menu item update 1273 --link=https://beta.net --position=1

db_id,type,title,link,position
1272,custom,Alpha,https://alpha.com,1
1273,custom,Beta,https://beta.net,2

Describe what you would expect as the correct outcome

Position also should have been updated.

Let us know what environment you are running this on

OS:     Darwin 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov  7 21:48:06 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_X86_64 x86_64
Shell:  /bin/zsh
PHP binary:     /usr/local/Cellar/[email protected]/8.2.15/bin/php
PHP version:    8.2.15
php.ini used:   /usr/local/etc/php/8.2/php.ini
MySQL binary:   /usr/local/bin/mysql
MySQL version:  mysql  Ver 8.3.0 for macos13.6 on x86_64 (Homebrew)
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /Users/nilambarsharma/Sites/staging
WP-CLI packages dir:    /Users/nilambarsharma/.wp-cli/packages/
WP-CLI cache dir:       /Users/nilambarsharma/.wp-cli/cache
WP-CLI global config:   /Users/nilambarsharma/.wp-cli/config.yml
WP-CLI project config:  /Users/nilambarsharma/Sites/staging/wp-cli.local.yml
WP-CLI version: 2.10.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions