Skip to content

Instantly share code, notes, and snippets.

@tarikcayir
Created February 19, 2015 16:52
Show Gist options
  • Save tarikcayir/74400ab415f67a05940a to your computer and use it in GitHub Desktop.
Save tarikcayir/74400ab415f67a05940a to your computer and use it in GitHub Desktop.
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