-
Notifications
You must be signed in to change notification settings - Fork 10
Adds new get and exists subcommands to the sidebar command
#70
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
Merged
swissspidy
merged 12 commits into
wp-cli:main
from
iamsohilvahora:doc/update_wp_sidebar_details
Feb 11, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
805bba3
Adds new and subcommands to the sidebar command
iamsohilvahora 825c171
test(sidebar): make functional tests deterministic and CI-safe
iamsohilvahora 41975cd
test(sidebar): fix gherkin multiline steps and make tests CI-safe
iamsohilvahora 2d5adcb
test(sidebar): make functional tests deterministic and CI-safe
iamsohilvahora 0181329
test(sidebar): make functional tests deterministic and CI-safe
iamsohilvahora 770b58e
Checked all test and passed
iamsohilvahora 530c09a
Updated sidebar feature with background process
iamsohilvahora 06bd4b1
Update src/Sidebar_Command.php
iamsohilvahora 46cdb3d
Updated last scenario in sidebar feature file and updated list of for…
iamsohilvahora 0364e0b
Merge branch 'doc/update_wp_sidebar_details' of https://github.com/ia…
iamsohilvahora 8c3a208
Updated last scenario in sidebar feature file and updated list of for…
iamsohilvahora 4e8ec50
Added new line at the end
iamsohilvahora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,48 @@ | ||
| Feature: Manage WordPress sidebars | ||
|
|
||
| Scenario: List available sidebars | ||
| Background: | ||
| Given a WP install | ||
|
|
||
| When I try `wp theme delete twentytwelve --force` | ||
| And I try `wp theme delete twentytwelve --force` | ||
| And I run `wp theme install twentytwelve --activate` | ||
| Then STDOUT should not be empty | ||
|
|
||
| Scenario: List available sidebars | ||
| When I run `wp sidebar list --fields=name,id` | ||
| Then STDOUT should be a table containing rows: | ||
| | name | id | | ||
| | Main Sidebar | sidebar-1 | | ||
| | First Front Page Widget Area | sidebar-2 | | ||
| | Second Front Page Widget Area | sidebar-3 | | ||
| | Inactive Widgets | wp_inactive_widgets | | ||
|
|
||
| When I run `wp sidebar list --format=ids` | ||
| Then STDOUT should be: | ||
| """ | ||
| sidebar-1 sidebar-2 sidebar-3 wp_inactive_widgets | ||
| """ | ||
|
|
||
| When I run `wp sidebar list --format=count` | ||
| Then STDOUT should be: | ||
| """ | ||
| 4 | ||
| """ | ||
|
|
||
| Scenario: Get sidebar details | ||
| When I run `wp sidebar get sidebar-1` | ||
| Then STDOUT should contain: | ||
| """ | ||
| sidebar-1 | ||
| """ | ||
|
|
||
| Scenario: Sidebar exists command returns success | ||
| When I run `wp sidebar exists sidebar-1` | ||
| Then the return code should be 0 | ||
|
|
||
| Scenario: Sidebar exists command returns failure | ||
| When I try `wp sidebar exists does-not-exist` | ||
| Then the return code should be 1 | ||
|
|
||
| Scenario: Get non-existing sidebar returns error | ||
| When I try `wp sidebar get does-not-exist` | ||
| Then STDERR should contain: | ||
| """ | ||
| does not exist | ||
| """ | ||
| And the return code should be 1 | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.