Here’s how we do it:
$user = get_user_by('email', $email);
if (wp_check_password($password, $user->user_pass, $user->ID)) {
// Login successfull, redirect if needed
wp_set_auth_cookie($user->ID);
}
Assuming of course that you got the $email and the $password variables from a POST request or something 🙂
Related Posts:
- Check for correct username on custom login form
- My login form does not work
- Change register form action url
- How can i add validation to this login form with out it redirecting to the wp-login.php page
- Redirecting or displaying a message on first login
- How can I do a URL redirection when an user uses wrong login details?
- How to modify the action attribute of the wp-login.php?action=register form?
- Redirecting after login?
- Sidebar login widget with error print, returns an error
- How can I insert wordpress login screen on a different domain?
- Change default login auth
- WordPress registration page template
- How to post frontend login form to a different authentication script from wp-login?
- wp_signon works localhost but not wokrs https site
- How to Create a login for for subscribers only
- How can I customize the content of the login page?
- authenticate to another site using a login form on my site
- Increase of failed login attempts, brute force attacks? [closed]
- How to prefill WordPress registration with social details
- Replacing the WordPress password validation
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- Website Visible only to Registered users
- How do I use add_action from a class method?
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- How do I check if a post is private?
- Action wp_login_failed not working if only one field is filled out
- Display last login time
- Show newly added posts since last user login time /date
- how to update current logged user username
- Custom Reset Password & Forgot Password Front End Forms
- Redirect User to Homepage if no other redirect is specified
- Admin user getting message ‘You need a higher level of permission’
- How to implement Google reCaptcha without installing a plugin?
- Problem with logging in WP users automatically
- advance membership managment
- Logins through alias
- Redirect users to a front end wp login page
- How can I allow access to multiple users, using the same login, at the same time?
- wp_get_referer not working properly after wp_redirect
- Login Button CSS
- Force Users to Login – loop problem
- Is there a better way than checking user is logged in to show or hide adminbar?
- Show errors on custom login form [duplicate]
- Index page and random posts needs a forced refresh in order to show new content
- How to change wordpress Log In text
- Can I (and should I) change the login-URL from functions.php?
- Change CSS based on is_user_logged_in
- How to remove ‘wordpress…’ text from page titles in tabs
- Using gettext to translate wp-login.php can’t translate `Back to` into other language
- Code for Log Out Button Yields Strange URL
- Display first name instead of username
- How can I make a login just like on wordpress.org?
- How to Prevent Brute Force Attack on WordPress
- Echo Text If User Is Logged in But NOT the Author of post
- autocomplete=”off” WordPress Login
- Why there is a 302 status when my account and password are right?
- 503 Login WordPress [closed]
- Can I edit the database to change a login?
- Can user meta be shown or hidden depending on user logged in status?
- Password recovery URL has error – but not found in code or db
- Cannot Get User id after login success in file wp_login.php
- This webpage has a redirect loop issue
- authenticate user without redirecting
- Create front end member login
- Logging in to the frontend works correctly but not for WP-Admin
- Restrict users of site 1 to login in site 2 in wordpress multisite
- No plugin populate user information in to form
- Cannot login to WordPress on one device: login refreshes/an error was encountered whilst trying to authenticate
- How to block specific user id in custom login form?
- Make an order of products without login
- Updated : how to make email optional while user registration using default wordpress form
- Bypass login page
- Login issue with subdomain installs
- Using WordPress login for a non word-press website
- Using is_user_logged_in() to lock down whole site
- How can i add user display name drop down menu in frontend?
- After moving WordPress to its own directory, login doesn’t work
- WordPress login is not showing , there is warning?
- WordPress Redirect After logging
- Issue logging in from second computer
- Login problem with https
- Specific Content on pages based on user
- WordPress auto login user after registration only from a specific page
- Custom Field For Login
- User login without username, only password
- Opening protected page with cookie?
- Login user after registration programmatically
- wp_lostpassword_url not escaped
- Directory authentication initially succeeded, but no valid profile was found (“get entries” procedure)
- Trim the repeated value in URL
- Warning: session_start(): Cannot send session cookie – headers already sent by
- I can’t login to wordpress dashboard without SSH
- Member Area Login with Fail Message
- Username character requirements
- Users cannot log in using popup
- WordPress – Security Question at Login from User’s Meta Data
- determine active user browser at the same time
- issue with my wp site after login
- How to create a fully functional user registration in WordPress?