Fix: wp menu item update --position does not reshuffle other menu items#603
Draft
Fix: wp menu item update --position does not reshuffle other menu items#603
wp menu item update --position does not reshuffle other menu items#603Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix position not updated in wp menu item update command
Fix: Mar 18, 2026
wp menu item update --position does not reshuffle other menu items
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…stead of range SQL Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Copilot stopped work on behalf of
swissspidy due to an error
March 18, 2026 13:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wp menu item update <db-id> --position=Nwas updating the target item'smenu_orderbut leaving all other items untouched, resulting in duplicate or broken position ordering.Changes
menu_order(normalized:0 → 1) prior to callingwp_update_nav_menu_item()so the delta can be computed.new < old): items in[new_pos, old_pos - 1]shift down by +1new > old): items in[old_pos + 1, new_pos]shift up by -1reorder_menu_items_in_range(): Complements the existingreorder_menu_items()(used for add/delete) with a boundedBETWEEN-based SQL update instead of an unbounded>=.Example
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.