Support » Plugin: User registration & user profile - Profile Builder » Show password in password field

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Cristian Antohe

    (@sareiodata)

    Hi Jeff,

    It should be possible. It will need a bit of code to make it work so I’ll research it and get back to you tomorrow!

    Plugin Author Cristian Antohe

    (@sareiodata)

    Hi Jeff,

    That’s possible using a bit of coding:

    • Create an empty plugin like this: https://gist.github.com/sareiodata/76f701e01db6685829db
    • Add the following code to the end of it:
    • /*
       * Show Password in PB forms
       */
      add_filter('wppb_register_password', 'wppbc_show_pass', 10, 6);
      add_filter('wppb_edit_profile_password', 'wppbc_show_pass', 10, 6);
      function wppbc_show_pass( $output, $form_location, $field, $user_id, $field_check_errors, $request_data ){
      	return $output . '<div class="wppb-checkbox-terms-and-conditions"><label><input style="width:auto" type="checkbox" onchange="document.getElementById(\'passw1\').type = this.checked ? \'text\' : \'password\'; document.getElementById(\'passw2\').type = this.checked ? \'text\' : \'password\'"> Show password</label></div>';
      }
      
      add_filter('login_form_middle', 'wppbc_show_pass_login', 99, 2);
      function wppbc_show_pass_login($content, $args){
      	return '<p class="login-show-pass"><label><input id="show-password" type="checkbox" onchange="document.getElementById(\'user_pass\').type = this.checked ? \'text\' : \'password\' "/> Show password</label></p>' . $content;
      }
    • Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality

    If you need help with any of this, please let me know!

    Plugin Author Cristian Antohe

    (@sareiodata)

    Please use this piece of code. The one above didn’t work on the edit profile form. This should:

    /*
     * Show Password in PB forms
     */
    add_filter('wppb_register_password', 'wppbc_show_pass', 10, 6);
    add_filter('wppb_edit_profile_password', 'wppbc_show_pass', 10, 6);
    function wppbc_show_pass( $output, $form_location, $field, $user_id, $field_check_errors, $request_data ){
    	return $output . '<div style="display:block;" class="wppb-checkbox-terms-and-conditions"><label><input style="width:auto" type="checkbox" onchange="document.getElementById(\'passw1\').type = this.checked ? \'text\' : \'password\'; document.getElementById(\'passw2\').type = this.checked ? \'text\' : \'password\'"> Show password</label></div>';
    }
    
    add_filter('login_form_middle', 'wppbc_show_pass_login', 99, 2);
    function wppbc_show_pass_login($content, $args){
    	return '<p class="login-show-pass"><label><input id="show-password" type="checkbox" onchange="document.getElementById(\'user_pass\').type = this.checked ? \'text\' : \'password\' "/> Show password</label></p>' . $content;
    }

    Thanks again Cristian. Works!

    Best regards,
    Jeff

    Plugin Author Cristian Antohe

    (@sareiodata)

    Hi Jeff,

    I’m glad that worked out for you!

    Also, I was wondering, once you will have started using PB for a while, will it be too much to ask for you to leave a review of PB on http://wordpress.org/support/view/plugin-reviews/profile-builder ? One or two sentences will do it and it may help us to reach more people as well as get feedback from existing users.

    Hi Cristian,

    I only just tested an edit_profile page while the code above is active. When I try to change a user’s password I get the error message “error sending form”. It only works when I (admin) change my own password. I can’t change other users passwords. I also tested in editor mode, and wasn’t able to change password for editor or other users.

    Any thoughts?

    BR
    Jeff

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show password in password field’ is closed to new replies.