Guest User

Untitled

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