Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress log in process


  • sbask
    Participant

    @sbask

    We have a venue that has a wordpress/bbpress integration. In the past when a user signed up to the site in the woocommerce side, they weren’t assigned a forum role/rights until they actually logged into the forum. Is this something that was changed in an update to bbpress and is it customizable?

Viewing 4 replies - 1 through 4 (of 4 total)

  • Robin W
    Moderator

    @robin-w

    still works like that as far as I know. what do you want to customise.


    sbask
    Participant

    @sbask

    Currently it’s assigning them a forum role and we want them to not get assigned a role until they actually log in.


    Robin W
    Moderator

    @robin-w

    you are right ! Looks like it change on 2.6.

    It now does it on register

    so to change back to how it used to work

    in

    dashboard>settings>forums untick Automatically give registered visitors…etc

    Then put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    add_action('wp_login', 'rew_add_role');
    
    function 'rew_add_role' () {
    	$user_id = $user->ID ; 
    	$role = bbp_get_user_role( $user_id );
    	if (empty($role)) {
    		bbp_set_user_role( $user_id, 'bbp_participant' );
    	}
    }

    This code is untested, but should work, if not come back


    Robin W
    Moderator

    @robin-w

    you should note that under the code above, if in

    dashboard>users>edit user

    you set the forum role to ‘no role for these forums’ it will simply add them back as participant when they next log in

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar