Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Last active July 15, 2021 13:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheshwaghmare/b91ced0b4cb3dd686e4522bad4177284 to your computer and use it in GitHub Desktop.
Save maheshwaghmare/b91ced0b4cb3dd686e4522bad4177284 to your computer and use it in GitHub Desktop.
Create WordPress user though FTP.
<?php
/**
* Create new user.
*
* @todo remove `prefix_` with your own slug.
*
* @since 1.0.0
*/
if( ! function_exists( 'prefix_add_new_user' ) ) :
function prefix_add_new_user() {
$user_info = array(
'user_login' => 'admin',
'user_url' => 'http://example.com',
'user_pass' => 'admin@123',
'role' => 'administrator'
);
$user_id = wp_insert_user( $user_info ) ;
}
add_action( 'init', 'prefix_add_new_user' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment