• Resolved dsjohnson

    (@dsjohnson)


    Very cool plugin, appears to be just about what I need. I used it to create a taxonomy called members, where members can be Regular, student, inactive etc. As my application depends on Javascript and the REST API I added :
    ‘show_in_rest’ => true,
    ‘rest_base’ => ‘member’,
    and when I access the API at wp-json/wp/v2/member I get a listing with all member types and Id as expected. However I need to list all users of a member type so I was expecting wordpress/wp-json/wp/v2/user/?member=39 would give me a list of users with member id of 39. However it appears to ignore the ?members=39 and just returns all users.

    for reference I was looking at: https://jerryjones.dev/2018/03/26/taxonomy-queries-with-wordpress-v2-rest-api/ which has a similar example only for posts.

    Is something missing in the /Users endpoint that prevents this from working?
    Thanks for the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author shawfactor

    (@shawfactor)

    @dsjohnson honestly not an area I have looked into and from what you say my plugin does not cover this functionality. WordPress keeps adding functionality for taxonomies on the posts/pages/cpt side but does not officially support user taxonomies. My plugin tries to fill the gap and I′ve added some functionality recenntly, but the gap also grows.

    If you need this enhancement please contact me directly via my website or on shawfactor dot gmail dot com as i′d need to look at this as paid work (although optionally I′d happily publish the resulting enhancement back to the main plugin).

    Thread Starter dsjohnson

    (@dsjohnson)

    I though it might be a stretch. In my plugin I’ve over-used roles and thought user taxonomy would help. And if it was integrated into to WordPress like it is for posts/pages it would be great. I did some tests with my own REST endpoint and although it works, it is nothing like being able to use

    ` $users = get_users([‘role__in’ => [‘subscriber’]] );

    For now I’ll just use your plugin to assign a sub-set to my ‘subscriber’ role to help our treasurer out. User taxonomy is an interesting idea, maybe once I got this project working, i’ll look at it again.

    thanks.

    Plugin Author shawfactor

    (@shawfactor)

    As an alterantive I suggest buddypress. Its member types functionality is based on taxonomies and does incorporate rest support.

    I′m going to resolve for now. This is functionality I will get too eventually but for now I have other priorities.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘REST access to user Taxonomy’ is closed to new replies.