wp_authenticate [ WordPress Functions ]
wp_authenticate ( $username, $password )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
| Codex |
Similar Functions: wp_authenticate_cookie, wp_checkdate, wp_attachment_is_image, wp_auth_check, wp_authenticate_username_password
Checks a user's login information and logs them in if it checks out.
Source
function wp_authenticate($username, $password) {
$username = sanitize_user($username);
$password = trim($password);
$user = apply_filters('authenticate', null, $username, $password);
if ( $user == null ) {
// TODO what should the error message be? (Or would these even happen?)
// Only needed if all authentication handlers fail to return anything.
$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
}
$ignore_codes = array('empty_username', 'empty_password');
if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
do_action('wp_login_failed', $username);
}
return $user;
}Examples [ wp-snippets.com ]
Top Google Search Results
- Function Reference/wp authenticate « WordPress Codex
Description. Checks a user's login information and logs them in if it checks out. Parameters. $username: (string) (required) User's username. Default: None ...
codex.wordpress.org - Plugin API/Action Reference/wp authenticate « WordPress Codex
Plugin API/Action Reference/wp authenticate. Description. This action is located inside of wp_signon. In contrast to the wp_login action, it is executed before the ...
codex.wordpress.org - WordPress › Support » Tags — wp_authenticate
Tag: wp_authenticate Add New ». Topic, Posts, Last Poster ...
wordpress.org - WordPress › Support » wp_authenticate - is it magic?
Would some kind soul please provide a brief walkthru of how " do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass))" ends up calling ...
wordpress.org
User discussions [ wordpress.org ]
- bcworkz on "wp_authenticate redirects"
- BnMcG on "wp_authenticate redirects"
- bcworkz on "wp_authenticate redirects"
- BnMcG on "wp_authenticate redirects"
- tomviolin on "[Plugin: wpDirAuth] wp_authenticate override failing"
- loubas on "wp_authenticate and javascript"
- David Gwyer on "pluggable.php, functions.php and wp-admin"
- valpocreative on "pluggable.php, functions.php and wp-admin"
- David Gwyer on "pluggable.php, functions.php and wp-admin"
- Ipstenu (Mika Epstein) on "pluggable.php, functions.php and wp-admin"
