wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
342 stars 130 forks source link

return role of user #110

Closed umarsolehri closed 6 years ago

umarsolehri commented 6 years ago

user role returns null while getting user or users , so check that issue Or add that feature which return role of user while fetching users list or single user

polushinmk commented 6 years ago

Hi! this fields abailable only in edit context. Now you can get this only through QueryBuilder specifying Context = edit Example:

var usersquery = new UsersSqueryBuilder()
{
    Context=Context.Edit
};
var users = client.Users.Query(usersquery);

@ThomasPe should we add a context property to all of our endpoints like this done now with embeds?

ThomasPe commented 6 years ago

mh, I don't think that this is necessary for now since the context will probably be used far less often than _embed. Also, _embed is a global parameter according to the WordPress REST API Handbook, context is not.

ThomasPe commented 6 years ago

@umarsolehri did this work for you as proposed by @polushinmk?

umarsolehri commented 6 years ago

why we have to query when we can get all fields by simple query. this api is totally senseless

ThomasPe commented 6 years ago

k, thx.