Register without email!
-
Hello,
I just figured out how to make register without sending the email.
Here is how to do it:
#1 wp-login.php
Find
if ( $http_post ) { $user_login = $_POST['user_login']; $user_email = $_POST['user_email'];After that add:
$password = $_POST['password'];Replace
$errors = register_new_user($user_login, $user_email);
With
$errors = register_new_user($user_login, $user_email, $password);Find
<p> <label for="user_email"><?php _e('E-mail') ?><br /> <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label> </p>After that add
<p> <label for="password">Password<br /> <input type="text" name="password" id="password" class="input" value="<?php echo esc_attr(wp_unslash($password)); ?>" size="25" /></label> </p>And then remove the notice about sending random pwd.
#2 wp-includes/user.php
Find register_new_user function, make it like this:
function register_new_user( $user_login, $user_email, $password ) {find the checks and add:
// Check the password if ( !$password ) { $errors->add( 'empty_password', __( '<strong>ERROR</strong>: You haven\'t entered a password.' ) ); }elseif ( strlen($password) < 6 || strlen($password) > 25){ $errors->add( 'empty_password', __( '<strong>ERROR</strong>: Password is invalid (password is too short or too long.)' ) ); }Find
$user_pass = wp_generate_password( 12, false );
Replace with$user_pass = apply_filters('random_password',$password);GJ! Now there is no random passsword!
Regards,
– InCube.
The topic ‘Register without email!’ is closed to new replies.