wp_login returns error
-
I put
<?php wp_login(); ?>
in my template header, and I am getting this error message:Warning: Missing argument 1 for wp_login() in /home/blueribb/public_html/wp-includes/pluggable.php on line 170 Warning: Missing argument 2 for wp_login() in /home/blueribb/public_html/wp-includes/pluggable.php on line 170
Here is the function itself, starting at line 170:
function wp_login($username, $password, $already_md5 = false) { global $wpdb, $error; if ( '' == $username ) return false; if ( '' == $password ) { $error = __('<strong>ERROR</strong>: The password field is empty.'); return false; } $login = get_userdatabylogin($username); //$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'"); if (!$login) { $error = __('<strong>ERROR</strong>: Invalid username.'); return false; } else { // If the password is already_md5, it has been double hashed. // Otherwise, it is plain text. if ( ($already_md5 && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) { return true; } else { $error = __('<strong>ERROR</strong>: Incorrect password.'); $pwd = ''; return false; } } } endif;
Any thoughts as to why I’m getting this error? I put the function call for wp_register right before that, and it comes out just fine.
Thx.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_login returns error’ is closed to new replies.