Last active
February 8, 2021 13:15
-
-
Save jrmarqueshd/74446eb08d589bf99428ceea48e9dcfe to your computer and use it in GitHub Desktop.
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 jrm_create_new_user(){ | |
$user = 'username'; // Your username | |
$pass = 'password'; // Your Password | |
$email = 'e-mail'; // Your mail address | |
if( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); // User roles: default admin | |
} | |
} | |
add_action('init','jrm_create_new_user'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're welcome 😄