Closed ernilambar closed 7 months ago
@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.
@ernilambar How does WordPress core do it?
@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. 😰
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.
This approach is not solving the exact issue. Need more research on this. Closing this for now.
Fixes https://github.com/wp-cli/entity-command/issues/463
Eg:
wp menu item update 123 --position=2