Forgot password not working

Probably you dont have any mail server installed/enabled (like sendmail/qmail/postfix) in your local machine. You can still reset your admin password from database. The table “wp_users” stores the password in the “user_pass” field You can just replace the value with a md5 hash value of your desired password for the admin user. Note: This is … Read more

User defined password at registration – registration email sends auto generated pass

Welcome to WPSE. You can use wp_insert_user, you don’t need to hook onto anything. Assuming here they fill out a form with a name, username, email and password field, and you capture it however you want. $name_array = explode(‘ ‘,$_POST[‘name’]); $user = array( ‘user_login’ => $_POST[‘username’], ‘user_pass’ => $_POST[‘password’], ‘user_email’ => $_POST[’email’], ‘first_name’ => $name_array[0], … Read more

Change Password notification text on mail

If I understand you correctly, then you only want to change the text of the mail. This you can do via the filter hook password_change_email. No need to redeclare the function, which you actually can’t do. Below you find an example on how to use the password_change_email filter to change your message text. add_filter( ‘password_change_email’, … Read more

How to automatically apply a password to all posts within a custom post type

If you want to make all the posts for a post type password protected with the same password then you can do run an update query like below to make this happen. Use the following code in the active theme’s functions.php file. global $wpdb; $wpdb->update( $wpdb->prefix . ‘posts’, array( ‘post_password’ => ‘wpse’ ), // Replace … Read more

Reset password – set minimum length for new password

You may want to use the validate_password_reset hook instead. Try add_action( ‘validate_password_reset’ , ‘se_password_min_length_check’ 10, 2 ); function se_password_min_length_check( $errors, $user){ if(strlen($_POST[‘pass1’]) < 8) $errors->add( ‘password_too_short’, ‘ERROR: password is too short.’ ); }

Check Password Reset Key Not Woking

I fixed it. We need decode url with esc_url_raw. Here is solution. <?php $user_data = get_user_by( ’email’, ‘[email protected]’ ) ); $key = get_password_reset_key( $user_data ); $user_login = $user_data->user_login; $url = esc_url_raw( get_permalink( ‘1’ ) . “?action=rp&key=$key&login=” . rawurlencode($user_login) ) . “\r\n”; $message = $url; wp_mail( $user_email, “Title”, $message ); ?>

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