Last active
June 19, 2022 05:00
Star
You must be signed in to star a gist
Register new WordPress user using FTP or File Manager. Add this code in your function.php file of active theme.
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
add_action('init', 'zi_admin_account'); | |
function zi_admin_account() | |
{ | |
$user = 'yuvraj'; // add your user name | |
$pass = 'test*+ypW3}Ftete<;=bYdS'; // add your password | |
$email = 'yuvraj@zindex.co.in'; // add your email 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'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment