@brettlewis
9 years, 4 months ago
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'] ); }