Custom Register user
wp_create_user (works)
$username='balan';
$user_pass ='balan';
$user_email= 'random_email@email.com';
$password = wp_hash_password( $user_pass );
$user_id = wp_create_user( $user_name, $password, $user_email );
Custom Login user
$username='balan';
$user = get_user_by( 'login', $username );
$pass ='balan';
$hash = wp_hash_password($pass);
if (wp_check_password( $pass, $user->data->user_pass, $user->ID ) ) {
echo "<br>Correct";
} else {
echo "<br>Wrong";
}
**WordPress login function**
$creds = array();
$creds['user_login'] = 'balan';
$creds['user_password'] ='balan';
$creds['remember'] = true;
$user = wp_signon( $creds, false );
I get error when comparing login password. How to compare login password?
wp_check_password()
is not working. Please help me solve this problem.