Created
November 15, 2013 23:50
-
-
Save jeremyfelt/7493796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // from site-new.php | |
| $user_id = email_exists( $email ); | |
| if ( ! $user_id ) { // Create a new user with a random password | |
| $password = wp_generate_password( 12, false ); | |
| $user_id = wpmu_create_user( $domain, $password, $email ); | |
| if ( false == $user_id ) | |
| wp_die( __( 'There was an error creating the user.' ) ); | |
| else | |
| wp_new_user_notification( $user_id, $password ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment