Created
June 11, 2019 19:26
-
-
Save hamedmoody/d519ed43ff77e00606e7ada1b70bd869 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Upload to wp-content/mu-plugins/whichevernameyoulike.php | |
*/ | |
$login = 'foobar'; # New username | |
$password = 'barbaz'; # Password for the new user | |
$email = '[email protected]'; # Email address of the new user | |
$ip = '127.0.0.1'; # Insert your IP, http://google.com/search?&q=what%20is%20my%20ip | |
if ($_SERVER['REMOTE_ADDR'] === $ip) { | |
require_once(ABSPATH . WPINC . '/pluggable.php'); | |
require_once(ABSPATH . 'wp-admin/includes/' . 'user.php'); | |
$userdata = array( | |
'user_login' => $login, | |
'user_pass' => $password, | |
'user_email' => $email, | |
'role' => 'administrator', | |
); | |
$user_id = wp_insert_user($userdata); | |
var_dump($user_id); | |
die('delete me!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment