difficulties with bypass activation and auto-login
-
I swear this was working until very recently and I just noticed it no longer is and can’t work out why…
I use a customised registration form.
In my functions.php I have
add_filter( 'bp_core_signup_send_activation_key', '__return_false' );
and
add_action( 'bp_core_signup_user', 'my_user_signup', 5, 3 ); function my_user_signup( $user_id, $user_login, $user_password ) { global $wpdb; // WE SKIP BP ACTIVATION EMAIL, SO LET'S INCLUDE STEPS FROM bp_core_activate_signup HERE // Tell admin we have a new user wp_new_user_notification( $user_id ); // Activate user $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ); // Remove the activation key meta delete_user_meta( $user_id, 'activation_key' ); // ...Bunch of other stuff to do with populating extra profile fields... // Now sign them on $signon = wp_signon( array('user_login' => $user_login, 'user_password' => $user_password, 'remember' => false) ); //Redirect if ( is_wp_error($signon) ) { error_log( "auto-login error for user " . $user_id . " : " . $signon->get_error_message() ); } else { wp_redirect( home_url('some-page') ); exit; }
Now, in every case, it is logging the error “Your account has not been activated. Check your email for the activation link” and so failing to log them in and redirect.
Any ideas?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘difficulties with bypass activation and auto-login’ is closed to new replies.