Created
May 7, 2019 05:06
-
-
Save mohammadmursaleen/3c11ee9fce49ded42e8202cc150b354b to your computer and use it in GitHub Desktop.
Update user password using functions.php file 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('init' , 'mm_update_user' , 0); | |
function mm_update_user(){ | |
$user = get_user_by( 'login', 'developer' ); // Replace 'developer' with username | |
$user_id = $user->ID; | |
$password = 'sfsdfsdfsdf123SFSD#'; | |
wp_set_password( $password, $user_id ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment