Skip to content

Instantly share code, notes, and snippets.

@sandeshjangam
Created January 11, 2018 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeshjangam/66070130cca414d3c20c0c0962f77993 to your computer and use it in GitHub Desktop.
Save sandeshjangam/66070130cca414d3c20c0c0962f77993 to your computer and use it in GitHub Desktop.
Add user in WordPress through FTP
<?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