D
D
Denis Shishkin2016-10-27 14:23:07
WordPress
Denis Shishkin, 2016-10-27 14:23:07

How to reduce woocommerce password complexity requirement (on registration)?

How to reduce woocommerce password complexity requirement? I figured out how to remove it in general, but I would still like the requirement to remain, but for example with parameters:
the password will have at least 6 characters, upper and lower case, numbers.
What I tried:
I tried to insert this code into the theme function file:

add_filter( 'woocommerce_min_password_strength', 'uh_oh_weakpasswords' );

function uh_oh_weakpasswords() {
return 1;
}

But didn't feel any difference.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Petrovsky, 2016-10-28
@Redjek

what is the bad way?

function wc_ninja_remove_password_strength() {
  if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
    wp_dequeue_script( 'wc-password-strength-meter' );
  }
}
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question