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 ); ?>

Force all users in MU to change their passwords

You can use PassExpire force all users to change password at next login. Or set it to expires user passwords after 60 (Variable) days and requires a password change on login. Note: This is community wiki answer for this Question (as @tony-zeoli has already answered his own question).

Where should you reset postdata?

Short version: As Tom J Nowell said, You shouldn’t cleanup if there’s nothing to clean Long version: However, if you put wp_reset_postdata() after (or outside) the loop, it would still work perfectly fine. I have used the function in various scenarios, including something like this: dynamic_sidebar( ‘main-sidebar’ ); wp_reset_postdata(); The reason was that some widget … Read more

Email user when password is reset by admin

Here’s one way to add this feature using the following flowline : The admin updates the user option page: -> edit_user_profile_update or personal_options_update hooks activated -> edit_user() function is called -> wp_update_user() function is called within edit_user() -> wp_insert_user() function is called within wp_update_user() -> profile_update hook activated within wp_insert_user() for user updates, not user … Read more

How do I create a password reset link?

After much research, I finally turned to examining the WordPress core file wp_login.php hoping that WP would show how they do it in a non-obtuse manner. From the information around line 331 (WP 4.6.1), I put together the following code. <?php global $gw_activate_template; extract( $gw_activate_template->result ); $url = is_multisite() ? get_blogaddress_by_id( (int) $blog_id ) : … Read more

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