• Resolved meadows19

    (@meadows19)


    Hello

    Thank you for making this plugin.

    There is a lot of funtionality built in.

    But i don’t need:
    Firefox and Chrome login form restructure
    Warning message
    Password advice message
    Generate Password button

    All I want is to clear the confusing crazy autogenerated password and let my users choose their own passwords. I just want the password field to be blank when my users end up on that page.

    So my question is: is there any code I can take from your plugin and stick in my functions.php file that will let me do only that? Could you please suggest what it is?

    Thank you kindly.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Fidgety Lizard

    (@fliz)

    Hi there,

    To do this you would need to take the JavaScript file js/flizcpr-password.js
    and cut out the bits you don’t need. (Look for the comment that says “Clear the initial password suggestion form” and keep that bit of JQuery.)

    Then you’d need to add code to your theme to load this js on the login pages only. Take a look at line 36 and lines 120-135 in clarify-password-reset.php to see what hooks are in use.

    Hope this helps!

    Thread Starter meadows19

    (@meadows19)

    Hello,

    Thanks for your reply and help!

    So basically, it’s only this one line?

    
    /* Version 1.1 */
    /*
     * Clears the auto-suggested password to avoid confusing users.
     *
     */
    jQuery( document ).ready( function( $ ) {
    
      /* Clear the initial password suggestion from WordPress */
      $( '#resetpassform input[name=\'pass1\']' ).attr( 'data-pw', '' )
    });

    Now I need to use this:

    add_action( 'login_enqueue_scripts', array( $this, 'add_scripts' ) );

    and this

          // Add the JS that does the JQuery/Ajax password field tweaking
          wp_enqueue_script(
            'flizcpr-password-js',
            plugin_dir_url( __FILE__ ) . 'js/flizcpr-password.js',
            array( 'jquery' ) // Depends on jquery
          );
    
          // Make sure that our JS can find the Ajax endpoint, and knows whether
          // to attempt the browser fix
          wp_localize_script( 
            'flizcpr-password-js', 
            'flizcpr', 
            array( 
              'ajaxurl' => admin_url( 'admin-ajax.php' ),
              'savefix' => get_option( 'flizcpr_savefix' )
             ) 
          );

    to try and make a custom plugin. I’m going to try and figure that out and hopefully will post back here to let you know how it goes.

    Thank you again.

    Plugin Author Fidgety Lizard

    (@fliz)

    Hi there,

    You would also need to tweak the add_action() call to reflect that fact that your function (in theme’s functions.php) is not a class member anymore.

    I figured other people might find this simplified functionality useful too, so I’ve put together a plugin that will do just this, called “No Suggested Password”. I’ll submit it to the WordPress repository today, and hopefully it will become available within a day or two. If you need it urgently, send me a message with your email address via the Fidgety Lizard website, and I’ll send you a zip file.

    Cheers!

    Thread Starter meadows19

    (@meadows19)

    Fantastic! Thank you so much. I already spent an hour or two trying to figure out how to get it to work, and was even considering hiring a freelancer to code it for me.

    I’ll wait until it’s on the repository. Again, thank you!

    Plugin Author Fidgety Lizard

    (@fliz)

    You’re most welcome! It’s submitted to the repository now; I’ll let you know once it becomes available.

    Plugin Author Fidgety Lizard

    (@fliz)

    Thread Starter meadows19

    (@meadows19)

    Wonderful. Thank you so much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Just want to clear the generated password’ is closed to new replies.