0

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.

0

Follow these instructions: Allow Users to Set Password During Registration

2
  • Thanks. can you integrate this hooks to my custom form? or explain how to use them? – Navid M Jan 21 '20 at 14:16
  • Please ofcourse – Navid M Jan 21 '20 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.