Created
August 22, 2016 16:00
-
-
Save mathewjosephh/b2b21c99d53ae5c77adc752096fd0946 to your computer and use it in GitHub Desktop.
Reset Password - Wordpress
This file contains 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 | |
$user_id = 1; # Insert your user ID or simply 1 for the first user that was created | |
$user_pass = 'secret'; # Insert a new password | |
$ip = '127.0.0.1'; # Insert your IP | |
if ($_SERVER['REMOTE_ADDR'] === $ip) { | |
require_once(ABSPATH . WPINC . '/registration.php'); | |
require_once(ABSPATH . WPINC . '/pluggable.php'); | |
$user = wp_update_user(array( | |
'ID' => $user_id, | |
'user_pass' => $user_pass, | |
)) ; | |
var_dump(get_userdata($user)); | |
die('disable me!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment