Use wp_signon()
. Ex:
$creds = array();
$creds['user_login'] = 'example';
$creds['user_password'] = 'plaintextpw';
$creds['remember'] = true;
$user = wp_signon( $creds, false );
if ( is_wp_error($user) )
echo $user->get_error_message();
Related Posts:
- How to update the delete user confirmation form?
- Enabling Sessions in WordPress 3.0
- Modify custom Users Manage page
- How to Save Different Usermeta Fields According to User Role?
- How to let a single post have its own domain name
- simple wp_insert_post example
- Best way to pass arguments to another page in WordPress
- WordPress change author email notify message?
- How can I add data to a custom column in the Users section of the wordpress backend?
- Unique User Account Number + Displayed Via Shortcode
- Last time a user logged in
- Remove the deleted users avatar from list
- How to remove tag cloud from taxonomy admin edit page?
- Updating Custom WordPress User Meta Field via REST API
- How to pass external variables to the wp_new_user_notification_email filter?
- How can I allow access to multiple users, using the same login, at the same time?
- Creating user relationships
- Function to allow “Anyone can register”?
- Make custom user table column filterable
- Add ‘Creator’ User Meta when adding user
- Follow me for WordPress blogs (multi-authors)
- Access post meta in future_to_publish function
- Author Tracking Code!
- Change the Labels of Users to Customers in Admin
- User can not login
- Allow guests to use WP Customizer but disable save button
- Users can only view their content from the front end
- List top 5 authors with most posts
- Multi-site User Sessions
- Problem with custom user meta field
- Condition OR for current user ID
- Customizing Users in Admin Area
- how to make a custom field readonly or disabled by user role?
- How to make wordpress use a non-wordpress users table?
- loginout function customization
- Problem with custom function from jQuery slider tutorial
- Different profile page by role
- Add array of post id’s to a category?
- Personalized Gallery what are my options?
- how or where wordress collect unlogged user session
- No plugin populate user information in to form
- Invitation link to a site in multisite network does not work?
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- How to display all post from the same current usermeta
- Highlight specific user with custom field value
- Change the functionality of wordpress users module in admin
- Changing starting number of User ID
- Custom search by several options send on form not works
- User registration add user ID?
- Display a list of users with avatar filterable with alphabets
- How to create functions that affect only a specific user
- Create users via PHP
- Use wp_login_form function to login with a custom user table?
- Is it possible assign a secondary existing role to already existing one?
- User Query Multiple Orderby Clause
- Some data of one custom user profile is erased when I update another custom user profile
- Add custom css to specific user
- Keep Title and Description always
- Custom CSS at Appearance > Edit CSS is missing after update [closed]
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- How to remove all the items under “Personal Options” on user profile page?
- the_post_thumbnail() returns nothing even though has_post_thumbnail() returns true
- orderby in query_posts
- What is the best way to move a single site from one MS installation to another? [duplicate]
- Extend WordPress Core Classes in OOP Theme?
- How To Load an HTML File As A WordPress Page (With No 301/No Redirect)
- how to display a specific wordpress menu?
- How to get every custom taxonomy names and urls?
- My custom sql query for getting a username giving me a warning and an error
- Custom Login Process
- How could I verify whole WP directory before/after working with a freelancer? [closed]
- different style sheet for just one page template
- Installing new theme on running site
- Customize option – add two image uploader under same section
- How to customize
- Hide text if not homepage
- Get Custom Taxonomy Terms by Date
- A truely custom login page?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How can I stop access of unregistered user in wp-content/uploads directory without using .htaccess file?
- Combine two conditions in one statement syntax [closed]
- Your thoughts on the interaction with one custom database table from WP?
- Add Field to WordPress Register Form
- How to customize and keep things up-to-date?
- Adding comments to my custom theme
- How to store page visit counts?
- What are “best practices” for wp-config.php
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- “operation successful” message
- Best way to tell if a comment is from a user?
- Instant install of wordpress
- Problem with theme activatation
- How to customize feed?
- Add content in between of foreach
- User bar above logotipo?
- How to solve this problem with my subdomain?
- Create a url structure for my blogs based on categories and sub-cats
- How to insert a writing panel between the title and the page content?
- Two description meta tags All in One SEO WordPress [closed]