Skip to:
Content
Pages
Categories
Search
Top
Bottom

Default User Role Blocked from ALL BuddyPress

  • @fuzzllc

    Participant

    Hi!

    I’m having a difficult time coming up with a solution for this…

    We’re trying to set a default user role that, when logged in by default, doesn’t have any access to BuddyPress at all.

    Then, when the administrator switches the user role they would be able to use all of the BuddyPress system.

    Any ideas?

    Thanks for the help!
    Nick

Viewing 1 replies (of 1 total)
  • @henrywright

    Moderator

    Hi @fuzzllc

    A way of doing this would be to override the user’s role when they sign up. BuddyPress provides a hook we can use for this bp_core_signup_user. So, you could do something like this:

    function fuzzllc_set_default_role( $user_id ) {
        $user = new WP_User( $user_id );
        $user->set_role( 'keymaster' ); // keymaster can be whatever you like
    }
    add_action( 'bp_core_signup_user', 'fuzzllc_set_default_role' );
Viewing 1 replies (of 1 total)
  • The topic ‘Default User Role Blocked from ALL BuddyPress’ is closed to new replies.
Skip to toolbar