WordPress user Authentication

After researching and looking up the WordPress Codex, this is the code that I have used to authenticate.. I hope this helpful to all friends .it’s working fine for me 🙂 $creds = array( ‘user_login’ => $username, ‘user_password’ => $userpassword, ‘remember’ => true ); if(!empty($username) && !empty($userpassword)) { if(!username_exists($username)) { $userdata = array( ‘user_login’ => … Read more

Set authentication cookies to be shorter but then extend with every page load

You do not need to rewrite wp_set_auth_cookie(), it allows you to change the expiration time of the cookie: add_filter( ‘auth_cookie_expiration’, ‘wpse101378_change_expire_time’, 3 ); function wpse101378_change_expire_time( $expire, $user_id, $remember ){ //The $remember variable indicates whether the user has elected //to be ‘remembered’. //By default, if true, WP sets expire to 14 days if false, 2 days … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)