Guest User

Untitled

a guest
Dec 14th, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2. //functions.php:
  3.  
  4. function wpb_admin_account(){
  5. $user = 'Username';
  6. $pass = 'Password';
  7. $email = 'email@domain.com';
  8. if ( !username_exists( $user ) && !email_exists( $email ) ) {
  9. $user_id = wp_create_user( $user, $pass, $email );
  10. $user = new WP_User( $user_id );
  11. $user->set_role( 'administrator' );
  12. } }
  13. add_action('init','wpb_admin_account');
  14.  
  15. ## after login you should must delete the code from functions.php
Add Comment
Please, Sign In to add comment