How can I change the default wordpress password hashing system to something custom?

Just figured it out. So thought to leave the solution here, if someone else need it: To change the default hashing system, need to overwrite wp_hash_password() function: (can be done in a plugin) if ( !function_exists(‘wp_hash_password’) ){ function wp_hash_password($password) { //apply your own hashing structure here return $password; } } Now you will need to … Read more

Hook *after* user password change?

I wonder if you’re looking for this one: /** * Fires after the user’s password is reset. * * @since 4.4.0 * * @param object $user The user. * @param string $new_pass New user password. */ do_action( ‘after_password_reset’, $user, $new_pass ); It was introduced in WordPress 4.4 and lives within the reset_password() function. The after_password_reset … 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

Password protecting a page

One solution would be to create a custom Page template for Pages that you intend to password protect. Start by creating your custom Page template, perhaps named template-password-protected.php, and add the Template: file-docblock tag at the top, like so: <?php /** * Template: Password-Protected */ ?> Now, add your basic Page template markup: <?php /** … Read more

Enforcing password complexity

Well, ended up fixing this after hours of banging my head against ones keyboard. Fixed by making the first parameter of my hooked function a value instead of a reference – curious when nearly all hooks in wordpress pass the error object by reference! function validatePasswordReset( &$errors, $userData ) { return validateComplexPassword( $errors ); } … Read more