Skip to content

Improve wp remove-cap command #530

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BhargavBhandari90
Copy link
Contributor

@BhargavBhandari90 BhargavBhandari90 commented Apr 5, 2025

Fixes #98


Let's start with this:


  • Added Role ExMember and capability exmember
  • Now when we try to run comman: wp user remove-cap 1 exmember
  • It will have error ( see the screenshot below ): There is a role similar to 'exmember' capability. Use wp user remove-role instead.
image

@BhargavBhandari90 BhargavBhandari90 requested a review from a team as a code owner April 5, 2025 22:03
Copy link

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@swissspidy
Copy link
Member

Thanks for starting this!

The example you mentioned would make for a good Behat test :-) Would you be up for adding one?

@BhargavBhandari90
Copy link
Contributor Author

Sure @swissspidy I'll add the Behat test. Thank you.

@BhargavBhandari90 BhargavBhandari90 changed the title WIP: Improve wp remove-cap command Improve wp remove-cap command Apr 9, 2025
@BhargavBhandari90
Copy link
Contributor Author

@swissspidy added behat test. Let me know if this works.

@swissspidy
Copy link
Member

The original suggestion in #98 (comment) was to add a --force flag to ignore the error and still remove the cap, maintaining existing behavior

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.

Passing a role name to wp user remove-cap should probably return an error
2 participants