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

User Site List in Network/Multisite #153

Closed
danbeach opened this issue Oct 9, 2020 · 3 comments
Closed

User Site List in Network/Multisite #153

danbeach opened this issue Oct 9, 2020 · 3 comments

Comments

@danbeach
Copy link

danbeach commented Oct 9, 2020

Maybe this is already something that can be done, but I haven't found any simple or efficient way of doing this, so...

I think it would be great if there were a CLI command (likely wp user) that lists the sites a user is a member of in a multisite. Essentially, something that replicates the output of when you search for a user at the network level and it shows which (sub)sites that user is a member.

I know something can be done via shell, looping through the list of sites and checking for membership/role in each site, but that's time-consuming and clearly there's already functionality written that multisite uses in the GUI.

I imagine something like:
$ wp user site-list user

ID | Sites
1 | www.site.com/subsite1
3 | www.site.com/subsite3
8 | www.site.com/subsite8

where it would be possible to use --field=site output as a --url= parameter to then update or remove the user from the site.

It would be an added bonus if the same could output what roles the user has in the site, but that part is easy and already exists if I can quickly get the list of sites to check.

@danielbachhuber
Copy link
Member

danielbachhuber commented Nov 10, 2023

Thanks for the suggestion, @danbeach !

This seems like it would be a reasonable command. I'd suggest implementing it as a filter on wp site list.

Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices. The command will need to live in https://github.com/wp-cli/entity-command/

@marksabbath
Copy link

Will work on this.

@ernilambar
Copy link

Fixed in wp-cli/entity-command#438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants