Last active
July 16, 2023 07:09
-
-
Save kulterryan/a67d0656ffabf57d8a35beffbb562aa1 to your computer and use it in GitHub Desktop.
Set default password for every user in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('user_register', 'kr_alter_password', 10, 1); | |
function kr_alter_password($user_id) { | |
// user email. $user return full user info | |
// new entered password (plain text) | |
if ( $user_id ) { | |
wp_set_password( "[your-password]", $user_id ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment