Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • brettlewis
    Participant

    @brettlewis

    Try this out:

    add_action( 'user_register', 'assign_membership_on_register', 10, 1 );
    function assign_membership_on_register( $user_id ){
    	$user_info = get_userdata( $user_id );
    	$email = $user_info->user_email;
    	$data = array(
    		      'school1.edu' => array(
    				'bp_id' => 2,
    			),
    		      'school2.edu' => array(
    				'bp_id' => 3,
    			)
    		      );
    
    	$output = substr(strrchr($email, "@"), 1);
    	groups_accept_invite( $user_id, $data[$output]['bp_id'] );
    
    }
Viewing 1 replies (of 1 total)
Skip to toolbar