Last active
September 19, 2016 12:46
-
-
Save Nikschavan/989bbad04761ca90e2db7fa6d35f9e12 to your computer and use it in GitHub Desktop.
Add this file in `wp-content/mu-plugins/user.php` and just reload the site, a new user will be created with username and password used in the script below.
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 | |
add_action( 'init', 'add_new_user' ); | |
function add_new_user() { | |
$website = "http://example.com"; | |
$userdata = array( | |
'user_login' => 'user_name', | |
'user_url' => $website, | |
'user_pass' => 'user_password', | |
'role' => 'administrator' | |
); | |
$user_id = wp_insert_user( $userdata ) ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment