Last active
October 3, 2017 21:19
-
-
Save ThatGuySam/2f8a8ba5ed4b133c3c77 to your computer and use it in GitHub Desktop.
Wordpress New User Ftp
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
function add_admin_acct(){ | |
$login = 'myacct1'; | |
$passw = 'mypass1'; | |
$email = 'myacct1@mydomain.com'; | |
if ( !username_exists( $login ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $login, $passw, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} | |
} | |
add_action('init','add_admin_acct'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment