WordPress.org

Ready to get started?Download WordPress

Forums

Confirm User Registration
Improve plugin to work with bbpress (1 post)

  1. Robin W
    Member
    Posted 2 months ago #

    This is a great plugin, and combined with 'SB welcome letter editor plugin' gives a great registration solution.

    However I'm using bbpress forum software and that has an extra set of roles that are forum specific. The way that bbpress sets up the bbpress role for authomatic registration is that it adds the bbpress role on the first login of the user - I haven't figured out it does that yet !

    The CUR plugin somehow interferes with that (not sure how) so that on approval the bbpress role is lost.

    I found that adding a couple of lines to your auth function adds the participant role, but loses the subscriber role !

    public function auth_users( array $user_ids )
    	{
    		if ( $user_ids && current_user_can( 'promote_users' ) ) :
    
    			foreach ( $user_ids as $user_id ) :
    
    				if ( is_numeric( $user_id ) ) :
    					update_user_meta( $user_id, 'authentication', '1' );
    					$array = array('subscriber', 'bbp_participant');
    					update_user_meta( $user_id, 'wp_capabilities', $array);
    					do_action( 'confirm-user-registration-auth-user', $user_id );
    					$this->send_notification( $user_id );
    				endif;

    in the user meta table wp_capabilities for a wordpress subscriber and bbpress participant looks like

    a:2:{s:13:"subscriber";b:1;s:13:"bbp_participant";b:1;}

    Any idea how I make that with the code above?

    https://wordpress.org/plugins/confirm-user-registration/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.