Guest User

Untitled

a guest
Oct 21st, 2017
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'init', function () {
  4.  
  5. $username = 'admin';
  6. $password = 'password';
  7. $email_address = 'webmaster@mydomain.com';
  8.  
  9. if ( ! username_exists( $username ) ) {
  10. $user_id = wp_create_user( $username, $password, $email_address );
  11. $user = new WP_User( $user_id );
  12. $user->set_role( 'administrator' );
  13. grant_super_admin( $user_id );
  14. }
  15.  
  16. } );
Add Comment
Please, Sign In to add comment