Last active
July 15, 2021 13:20
-
-
Save maheshwaghmare/b91ced0b4cb3dd686e4522bad4177284 to your computer and use it in GitHub Desktop.
Create WordPress user though 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
<?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