WordPress开发者和主题制作者的搜索引擎



is_user_spammy ›

Since3.0.0
已弃用n/a
is_user_spammy ( $user = null )
参数:
  • (string|WP_User) $user Optional. Defaults to current user. WP_User object, or user login name as a string.
    Required: No
    默认: null
返回:
  • (bool)
定义在:
文档:
Change Log:
  • MU

Check to see whether a user is marked as a spammer, based on user login.



源码

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;
}