Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix position in menu item update #471

Closed
wants to merge 2 commits into from

Conversation

ernilambar
Copy link
Member

Fixes #463

  • Fix position when updating menu item.

Eg: wp menu item update 123 --position=2

@ernilambar ernilambar requested a review from a team as a code owner February 15, 2024 06:39
@ernilambar
Copy link
Member Author

@danielbachhuber Can you please review this approach of fixing menu item positions? I could not find a way without performing SQL query in loop. Any other alternative approach you have in mind? I will add Behat test after we finalize PHP code.

@danielbachhuber
Copy link
Member

@ernilambar How does WordPress core do it?

@ernilambar
Copy link
Member Author

@danielbachhuber Core does not have need to update separately. All data are fetched from $_POST and items are updated in loop. I also looked at the REST API. It has endpoint to update menu item separately but it also has issue regarding menu order and position. These menu and menu items seem like a different beast. 😰

@danielbachhuber
Copy link
Member

I also looked at the REST API. It has endpoint to update menu item separately but it also has issue regarding menu order and position.

@ernilambar What is the issue? The same issue?

Feel free to start adding feature tests to this PR, if you'd like.

@ernilambar
Copy link
Member Author

This approach is not solving the exact issue. Need more research on this. Closing this for now.

@ernilambar ernilambar closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Position is not updated in wp menu item update command
2 participants