Last active
November 9, 2020 13:24
-
-
Save careydayrit/b6a790add017a18c609b2fba38173c28 to your computer and use it in GitHub Desktop.
Wordpress Password Confirm Link
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 | |
/** | |
* Auhor: Carey Dayrit | |
* Author URI: https://github.com/careydayrit | |
* License: GPL v2 or later | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
* | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
*/ | |
require './wp-blog-header.php'; | |
$user_id = 1; | |
$user = new WP_User( (int) $user_id ); | |
$url = is_multisite() ? get_blogaddress_by_id( (int) $blog_id ) : home_url('', 'http'); | |
$reset_key = get_password_reset_key( $user ); | |
$user_login = $user->user_login; | |
$reset_link = '<a href="' . network_site_url("wp-login.php?action=rp&key=$reset_key&login=" . rawurlencode($user_login), 'login') . '">' . network_site_url("wp-login.php?action=rp&key=$reset_key&login=" . rawurlencode($user_login), 'login') . '</a>'; | |
?> | |
<html> | |
<head> | |
<style> | |
body{ | |
margin:25px; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>Password Reset</h2> | |
<p>To reset your password, visit the following address:</p> | |
<?php echo $reset_link; ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment