Created
January 11, 2018 05:34
-
-
Save sandeshjangam/66070130cca414d3c20c0c0962f77993 to your computer and use it in GitHub Desktop.
Add user in WordPress through FTP
This file contains hidden or 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