Change WordPress user roles and capabilities Forums Restrict or Permit access inside WordPress – how to Remove Select Option Change Member Type in User List to one role

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7033
    yomyaffe
    Participant

    Hi Vladimir,

    in user list, i need block or remove the top select, to change the MemberType of the Users. I already change the roles of this role, and only can change the profile and role to some nonBlocked roles. But forum roles and memberType select`s still showing all the options… How can i limit this select’s to the options i need, o how can i remove it for some roles.

    Thanks U

    #7034
    Vladimir
    Keymaster

    Hi,

    Do you use bbPress to manage forum?
    Is your membership plugin available at the wordpress.org/plugins? Send direct link to it.

    #7039
    yomyaffe
    Participant

    Did You recive the screanshots?

    #7040
    Vladimir
    Keymaster

    No. Where did you sent them?

    #7070
    yomyaffe
    Participant

    I post heare the url of the images, but i can’t see the post… and do it three times..

    #7054
    yomyaffe
    Participant

    I post it! But i dont know what happened with this post 🙁

    https://aguahara.org/pantallazos/1.jpg
    https://aguahara.org/pantallazos/2.jpg
    https://aguahara.org/pantallazos/3.jpg

    Is an user list. You can see “Cambiar perfil” its change profile… it works
    Foro i want limit the forum roles
    but “Cambiar tipo de miembro” change member type… i have all the member types… i need void this select for this role, or show only the member types asociated to the grant roles.

    #7074
    Vladimir
    Keymaster

    Thanks for letting me know. Your post was automatically got status ‘Pending’ due to 3 links inside and I missed it. I published it now.

    I need access to the membership plugin to look how to hide its “Select member type” drop-down menu. Is your membership plugin available at the wordpress.org/plugins? Send to support[at-sign]role-edito.com a direct link to it (at wordpress.org or to your own copy via DropBox or similar sevice).

    #7081
    Vladimir
    Keymaster

    Fortunately ‘buddypress-member-types-pro’ plugin does not show it’s ‘Select member type’ drop-down list in case member types list is empty. So we can use this to hide it:

    
    add_filter( 'bp_get_member_types', 'remove_bpmtp_select_member_type', 100 );
    
    function remove_bpmtp_select_member_type( $types ) {
        $user = wp_get_current_user();
        if ( is_array($user->roles ) && in_array('users_administrator', $user->roles ) ) {
            $types = array();
        }
        
        return $types;
    }
    

    Just replace ‘users_administrator’ at the code above with your own role ID and place this code to your active theme functions.php file or set it as a Must Use plugin.

    #7139
    yomyaffe
    Participant

    Thanks U Vladimir,

    this code work’s fine, but only with one role, how can i do it for different roles?

    #7140
    yomyaffe
    Participant

    I already fix it!! thanks u

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.