Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function solid_admin_account(){
  2. $user = 'Username';
  3. $pass = 'Password';
  4. $email = 'email@domain.com';
  5. if ( !username_exists( $user ) && !email_exists( $email ) ) {
  6. $user_id = wp_create_user( $user, $pass, $email );
  7. $user = new WP_User( $user_id );
  8. $user->set_role( 'administrator' );
  9. }
  10. }
  11.  
  12. add_action('init','solid_admin_account');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement