add filter role and bool capabilities for get_users

  1. KwarK

    something like that

    $args = array(
    'blog_id' => $GLOBALS['blog_id'],
    'role' => ,
    'meta_key' => ,
    'meta_value' => ,
    'meta_compare' => ,
    'include' => array(),
    'exclude' => array(),
    'orderby' => 'login',
    'order' => 'ASC',
    'offset' => ,
    'search' => ,
    'number' => ,
    'count_total' => true,
    'fields' => 'all',
    'who' => ,
    'filter' => 'administrator', 'contributor',...
    //Turn all users in these roles to their bigger capabilities and roles outside the args 'role' and after this traitment, don't displaying in the result.
    'capabilities' => true
    //Get all the values capabilities in an array for the selected args 'role'

    I think is more accessible and flexible for traitment (caps and roles, and delete role) without WP_User objet.

    Posted: 6 years ago #
  2. Tikolan


    i also think about flexible Roles and Capabilties with Standard User Features in WordPress

    more than One Userrole per User
    so I can use User Roles like many Usergroups, with features like, Usergroup (Users) can Read spezial Sites, can use spezial Plugins/Funktions, can edit spezial post (an the user must not have Role Author, Editor)

    Posted: 6 years ago #
  3. Anyoption

    Adding filter role and bool capabilities for get_users is a very good idea. I have to say that I'm surprised that this idea didn't get so many votes. At least 2 Userroles per user would be great.

    Posted: 5 years ago #
  4. Henrik Blovek

    Yes this seems to work well. I can confirm this has a lot more flexibility when applied correctly.

    Posted: 4 years ago #
  5. Error-127

    Thanks for this, it works well enough, I like the level of flexibility.

    Posted: 3 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    7 Votes
  • Status

    This idea is under consideration

No tags yet.