is_user_spammy( string|WP_User $user = null )

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


Description Description


Parameters Parameters

$user

(string|WP_User) (Optional) Defaults to current user. WP_User object, or user login name as a string.

Default value: null


Top ↑

Return Return

(bool)


Top ↑

Source Source

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

Top ↑

Changelog Changelog

Changelog
Version Description
MU (3.0.0) Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.