I would like to users can choose their own password on registration form and disable sending generated password email to them. Here it is my custom registration code:
<form id="register-form" class="wp-user-form" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post" role="form" style="display: none;">
<div class="g-login-div">
<a href="#" class="g-login-link">ثبت نام با حساب گوگل <i class="g-login-icon"></i></a>
</div>
<div class="panel-divider">
<hr><span class="or-text">یا</span><hr>
</div>
<label class="panel-body-label"> فرم ثبت نام را پر کنید:</label>
<div class="form-group">
<label for="user_login">نام کاربری</label>
<input type="text" name="user_login" id="user_login" tabindex="1" class="form-control" placeholder="نام کاربری" value="<?php echo esc_attr(stripslashes($user_login)); ?>">
</div>
<div class="form-group">
<label for="user_email">ایمیل شما</label>
<input type="text" name="user_email" id="user_email" tabindex="1" class="form-control" placeholder="ایمیل شما" value="<?php echo esc_attr(stripslashes($user_email)); ?>">
</div>
<?php do_action('register_form'); ?>
<div class="form-group">
<label for="user_pass">رمز عبور</label>
<input type="password" name="pwd" id="user_pass" tabindex="2" class="form-control" placeholder="رمز عبور" value="">
</div>
<div class="form-group">
<div class="row">
<div class="col">
<input type="submit" name="user-submit" id="register-submit" tabindex="4" class="form-control btn btn-register user-submit" value="ثبت نام">
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
<input type="hidden" name="user-cookie" value="1" />
</div>
</div>
</div>
</form>
Username and name created correctly in DB but not password.
I would like to users can choose their own password on registration form and disable sending generated password email to them. Here it is my custom registration code:
<form id="register-form" class="wp-user-form" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post" role="form" style="display: none;">
<div class="g-login-div">
<a href="#" class="g-login-link">ثبت نام با حساب گوگل <i class="g-login-icon"></i></a>
</div>
<div class="panel-divider">
<hr><span class="or-text">یا</span><hr>
</div>
<label class="panel-body-label"> فرم ثبت نام را پر کنید:</label>
<div class="form-group">
<label for="user_login">نام کاربری</label>
<input type="text" name="user_login" id="user_login" tabindex="1" class="form-control" placeholder="نام کاربری" value="<?php echo esc_attr(stripslashes($user_login)); ?>">
</div>
<div class="form-group">
<label for="user_email">ایمیل شما</label>
<input type="text" name="user_email" id="user_email" tabindex="1" class="form-control" placeholder="ایمیل شما" value="<?php echo esc_attr(stripslashes($user_email)); ?>">
</div>
<?php do_action('register_form'); ?>
<div class="form-group">
<label for="user_pass">رمز عبور</label>
<input type="password" name="pwd" id="user_pass" tabindex="2" class="form-control" placeholder="رمز عبور" value="">
</div>
<div class="form-group">
<div class="row">
<div class="col">
<input type="submit" name="user-submit" id="register-submit" tabindex="4" class="form-control btn btn-register user-submit" value="ثبت نام">
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
<input type="hidden" name="user-cookie" value="1" />
</div>
</div>
</div>
</form>
Username and name created correctly in DB but not password.
Share Improve this question asked Jan 21, 2020 at 12:19 Navid MNavid M 131 silver badge4 bronze badges1 Answer
Reset to default 0Follow these instructions: Allow Users to Set Password During Registration