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

list user --network excludes role from results #107

Open
tomwhita opened this issue Nov 1, 2017 · 3 comments
Open

list user --network excludes role from results #107

tomwhita opened this issue Nov 1, 2017 · 3 comments

Comments

@tomwhita
Copy link

tomwhita commented Nov 1, 2017

When running wp user list --network, the following fields are returned by default:

ID,user_login,display_name,user_email,user_registered

"roles", which listed in the documents as a default field is not being returned. It is returned when running wp user list but if multisite only users from the primary site are returned.

Please advise if there is an existing method to obtain all network users by role.

@danielbachhuber
Copy link
Member

Please advise if there is an existing method to obtain all network users by role.

There is not, because users can have different roles on different sites. We'll include some mention in the documentation to this effect.

To generate a list of all users with a given role, you'd need to list users for each site (see reference doc) and concatenate the list you've generated.

@BhargavBhandari90
Copy link
Contributor

@danielbachhuber Do we need to add this in the Example here?

wp site list --field=url | xargs -n1 -I % wp --url=% user list

@danielbachhuber
Copy link
Member

@BhargavBhandari90 I think the example will need to be a bit more involved to conclusively document this:

To generate a list of all users with a given role, you'd need to list users for each site (see reference doc) and concatenate the list you've generated.

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