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

Add reset subcommand for sidebar #3071

Closed
wants to merge 4 commits into from
Closed

Add reset subcommand for sidebar #3071

wants to merge 4 commits into from

Conversation

ernilambar
Copy link
Member

@ernilambar ernilambar commented Jun 27, 2016

Fixes #3063

@danielbachhuber
Copy link
Member

For this command, can you create a separate features/sidebar-reset.feature file and move your tests in there?

@@ -0,0 +1,67 @@
Feature: Manage WordPress sidebars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be "Reset WordPress sidebars"

@danielbachhuber
Copy link
Member

@ernilambar I just realized this uses a lot of code copied from class Widget_Command. Could we make this wp widget reset or similar, as to reuse the code?

@ernilambar
Copy link
Member Author

ernilambar commented Jun 29, 2016

@danielbachhuber I also felt that when I had to copy functions from Widget command. I even had this crazy idea of using launch_self for some tasks, but on searching I could only found two places where it is used now. So, I assumed it is best to avoid in core commands.

Since this is basically related to sidebar, I tried to keep it under sidebar command. Adding it under widget is also one approach I guess.

wp widget reset
Are we up for this?

  1. wp widget reset sidebar-1
  2. wp widget reset sidebar-1 sidebar-2
  3. wp widget reset --all
  4. wp widget reset [This should also throw error I believe. Like we do in plugin update - Error: Please specify one or more plugins, or use --all. ]
  5. wp widget reset wp_inactive_widgets [Should throw error.]

Re 5: There is button Clean Inactive Widgets in the /wp-admin/widgets.php. This functionality could be incorporated for command in 5. Or may be we should implement separately creating separate ticket?

@danielbachhuber danielbachhuber removed this from the 0.24.0 milestone Jun 29, 2016
@ernilambar ernilambar deleted the 3063-sidebar-reset branch June 29, 2016 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants