Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes #94
When a widget moves to another sidebar with
--position=<n>, it lands at position 1 instead of<n>if<n>is the same as its position in the current sidebar:Expected
archives-1at position 2, but the list shows:(
archives-1was at position 2 insidebar-1.)move()uses the current index as the new index when--positionis missing, and a move to another sidebar then resets the index to 0 when the new index equals the current index. That check also matches a given--positionwhose value equals the current position, so the position is ignored.The "add to the top" rule now checks whether
--positionwas given (empty( $assoc_args['position'] )) instead of comparing indexes. A move to another sidebar without--positionstill puts the widget at the top, and moves within the same sidebar are unchanged.Testing
Adds a scenario to
features/widget.feature, after "Widget CRUD". It movesarchives-1(position 2 insidebar-1) tosidebar-2with--position=2and checks thatwp widget list sidebar-2showssearch-2at 1 andarchives-1at 2.wp widget list sidebar-2showsarchives-1at position 1 andsearch-2at 2 (WordPress 7.1.4, MySQL 8.4).features/widget.feature(8 scenarios) passes on WordPress 7.1.4, MySQL 8.4.src/Widget_Command.php. The linter, Gherkin lint and PHPStan pass.AI assistance: I used Claude Code to find this and write the change; I reviewed and ran everything myself.
Summary by CodeRabbit