wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_is_password_reset_allowed_for_user › WordPress Function
Since6.3.0
已弃用n/a
› wp_is_password_reset_allowed_for_user ( $user )
| 参数: |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Checks if password reset is allowed for a specific user.
源码
function wp_is_password_reset_allowed_for_user( $user ) {
if ( ! is_object( $user ) ) {
$user = get_userdata( $user );
}
if ( ! $user || ! $user->exists() ) {
return false;
}
$allow = true;
if ( is_multisite() && is_user_spammy( $user ) ) {
$allow = false;
}
/**
* Filters whether to allow a password to be reset.
*
* @since 2.7.0
*
* @param bool|WP_Error $allow Whether to allow the password to be reset, or a WP_Error to explain
* why it is not allowed. Default true.
* @param int $user_id The ID of the user attempting to reset a password.
*/
return apply_filters( 'allow_password_reset', $allow, $user->ID );
}