Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用add_filter()检查强密码?_Php_Wordpress_Passwords_Verification_Add Filter - Fatal编程技术网

Php 如何使用add_filter()检查强密码?

Php 如何使用add_filter()检查强密码?,php,wordpress,passwords,verification,add-filter,Php,Wordpress,Passwords,Verification,Add Filter,我正在使用导师LMS,但注册页面不支持强密码验证。。注册者可以使用非常弱的密码进行注册,如:1或1234 所以我想编辑这个插件的register.php文件。。 我使用了以下代码,但它没有检查密码的强度。。有没有其他方法我可以用?通过使用add_filter() /** * Change the strength requirement on the woocommerce password * * Strength Settings * 4 = Strong * 3 = Medium (def

我正在使用导师LMS,但注册页面不支持强密码验证。。注册者可以使用非常弱的密码进行注册,如:1或1234

所以我想编辑这个插件的register.php文件。。 我使用了以下代码,但它没有检查密码的强度。。有没有其他方法我可以用?通过使用add_filter()

/**
* Change the strength requirement on the woocommerce password
*
* Strength Settings
* 4 = Strong
* 3 = Medium (default) 
* 2 = Also Weak but a little stronger 
* 1 = Password should be at least Weak
* 0 = Very Weak / Anything
*/
add_filter( 'woocommerce_min_password_strength', 'misha_change_password_strength' );

function misha_change_password_strength( $strength ) {
   return 4;
}