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
- Best Practices for Regression Testing WordPress Websites?
- What is true chmod for WordPress?
- wp_trim_words() does not trim the_content() in WordPress
- Gallery Shortcode: using link attribute to link to a specific image size
- get_theme_mod(); returns nothing
- Limit comments displayed on basis of user_id
- Outputting Page Content in Two Places
- Tag description doesn’t show hyperlink
- Post Thumbnail help
- Hide custom field if empty
- Admin Panel – Custom Menu Sub-Item LINK
- Adding custom styles to dropdown in editor
- Add custom user profile field to default WordPress MultiSite registration form
- Is there a way to dynamically get to your uploads folder?
- Updating Existed RocketTheme Theme on WordPress
- Setting custom search engine indexing for a “dynamic WordPress page” with htaccess
- how to add custom css and js on wordpress post editor directly without using .php file
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- URLs and navigation in custom themes
- How to move wordpress to subdomain, keeping only .htaccess and/OR index.php in root domain?
- Load MediaPlayerElement after Infinity Scroll loads more posts
- Is there a way to override require_once of the main theme on the child theme?
- Best Practice for Displaying Categorized Posts on Front Page
- How to create “custom page types” with different custom fields in them?
- How to Escape Custom Meta Data And Prefix Custom Meta ID
- Remove Customizer Control Choices (Type: Radio Array) using Child Themes
- How To Style Links in Content Area With Tag Automatically?
- Echo the Last Child Taxonomy only (not parents)?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Troubles about insering a POST with a SQL query, post_status
- WP-Bakery – Add custom colors to buttons with template colors
- Embed Latest Track (Dynamic Updating) SoundCloud
- Pull A Single Post Prior To Running wp_query
- Build custom pdf from users choices
- WordPress shortcode Issue!
- Changing a setting in the wp-admin/customize.php reverts CSS styles to parent theme [closed]
- Create a folder if it doesn’t already exist
- Changes in comments.php in the child theme does not show up on the site
- how to modify request to get_template_part()?
- Getting Custom Field value in WP_Query
- Adding Custom HTML/CSS/JS code in specific page
- Custom template not working for existing pages [closed]
- Help needed renaming custom post