函数原型
is_user_spammy( string|WP_User $user = null ): bool
函数描述
Determines whether a user is marked as a spammer, based on user login.
是否弃用
未弃用
函数参数
-
$user
string|WP_User
Optional - Defaults to current user. WP_User object, or user login name as a string.
Default:
null
函数返回值
bool
函数位置
File: wp-includes/ms-functions.php.
函数源码
function is_user_spammy( $user = null ) {
if ( ! ( $user instanceof WP_User ) ) {
if ( $user ) {
$user = get_user_by( 'login', $user );
} else {
$user = wp_get_current_user();
}
}
return $user && isset( $user->spam ) && 1 == $user->spam;
}
源码链接
变更日志
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |

