Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_action('init','add_new_admin');
function add_new_admin(){
$login = 'kullaniciadi';
$pass = '1';
$email = 'eposta@adresiniz.com';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $login, $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