由於網站的安全性,WordPress迫使我們使用強密碼強度表,例如:weak,medium和strong。但是,因此任何人都覺得它沒有用,並且也希望通過woocommerce支持從其WordPress網站禁用密碼強度儀。
在function.php 裡面加上以下 取消 未登入的用戶密碼強度檢查功能
add_action( ‘wp_default_scripts’, function($scripts){
if(!is_user_logged_in()) {
$scripts->remove(‘password-strength-meter’);
}
return $scripts;
} );
function gomahamaya_reduce_woocommerce_min_strength_requirement( $strength ) {
return 2;
}
add_filter( ‘woocommerce_min_password_strength’, ‘gomahamaya_reduce_woocommerce_min_strength_requirement’ );