• Resolved blakemiller

    (@blakemiller)


    Great plugin! I have used it on a handful of different sites for different environments.

    I have one custom environment where we need to set a common password for all users who register. This is an internal / intranet type of setup for a company.

    There is not a setting that I can tell, but is there a snippet / function that I can add that will set the password to a fixed / common value for everyone who registers?

    I have password field disabled, and I also override the default wordpress emails and notifications so the user will not receive a password reset email.

    FWIW – I typically use Gravity Forms for more complex and traditional sites that have user registration, and there are snippets available that will allow for this. It populates the field during pre_validation with a set value. The PW Field is also hidden in it’s field settings. (So it’s there, just hidden and blank until the form gets submitted)

    • This topic was modified 11 months, 1 week ago by blakemiller.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xootix

    (@xootix)

    Hello,

    “It populates the field during pre_validation with a set value.”
    Making the password field hidden and setting the field value, I don’t think that’s an ideal approach, anyone can unhide the field and set their own password value. Maybe this isn’t relevant in your case.

    Anyway, here is the backend snippet you can use to set a default password.

    add_filter( 'xoo_el_register_new_customer_data', function( $data ){
    			$data['user_pass'] = 'mycustompassword';
    			return $data;
    		} );


    Thread Starter blakemiller

    (@blakemiller)

    Thank you very much for this!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Force a common password?’ is closed to new replies.