How to show password fields on registration WordPress

I have install few wordpress plugin to test but i find out that i can not create an user name because in registration form not show Password filed to complete register requestment.

Add New User not working 1

I want to show hidden password fields on registration form. I found that these fields are already present in /wp-admin/user-new.php.

  1. <?php if ( apply_filters('show_password_fields', true) ) : ?>
  2. <tr class="form-field form-required">
  3. <th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(twice, required)'); ?></span></label></th>
  4. <td><input name="pass1" type="password" id="pass1" autocomplete="off" />
  5. <br />
  6. <input name="pass2" type="password" id="pass2" autocomplete="off" />
  7. <br />
  8. <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
  9. <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p>
  10. </td>
  11. </tr>
  12. <tr>
  13. <th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
  14. <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked( $new_user_send_password ); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
  15. </tr>
  16. <?php endif; ?>

I have try to do something to show password-field but no luck at all. Deactive all plugins then its work correct, may be plugins have conflict.

Add New User not working 2

Finanly, the problem is priority function. This code to fix this problem.

  1. if ( add_filter( 'show_password_fields', '__return_true', 999 ) ) : ?>
  2. <tr class="form-field form-required">
  3. <th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
  4. <td>
  5. <input class="hidden" value=" " /><!-- #24364 workaround -->
  6. <input name="pass1" type="password" id="pass1" autocomplete="off" />
  7. </td>
  8. </tr>
  9. <tr class="form-field form-required">
  10. <th scope="row"><label for="pass2"><?php _e('Repeat Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
  11. <td>
  12. <input name="pass2" type="password" id="pass2" autocomplete="off" />
  13. <br />
  14. <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
  15. <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p>
  16. </td>
  17. </tr>
  18. <tr>
  19. <th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
  20. <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked( $new_user_send_password ); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
  21. </tr>
  22. <?php endif; ?>