wpseek.com
A WordPress-centric search engine for devs and theme authors



is_user_spammy › WordPress Function

Since
Deprecatedn/a
is_user_spammy ( $user = null )
Parameters:
  • (string|WP_User) $user Optional. Defaults to current user. WP_User object, or user login name as a string.
    Required: No
    Default: null
Returns:
  • (bool)
Defined at:
Codex:
Change Log:
  • MU

Determines whether a user is marked as a spammer, based on user login.



Source

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