wp_authenticate_spam_check

The timeline below displays how wordpress function wp_authenticate_spam_check has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * For Multisite blogs, checks if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 *
 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
 */
function wp_authenticate_spam_check($user)
{
    if ($user instanceof WP_User && is_multisite()) {
        /**
         * Filters whether the user has been marked as a spammer.
         *
         * @since 3.7.0
         *
         * @param bool    $spammed Whether the user is considered a spammer.
         * @param WP_User $user    User to check against.
         */
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy($user), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>Error:</strong> Your account has been marked as a spammer.'));
        }
    }
    return $user;
}

WordPress Version: 5.4

/**
 * For Multisite blogs, check if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 *
 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
 */
function wp_authenticate_spam_check($user)
{
    if ($user instanceof WP_User && is_multisite()) {
        /**
         * Filters whether the user has been marked as a spammer.
         *
         * @since 3.7.0
         *
         * @param bool    $spammed Whether the user is considered a spammer.
         * @param WP_User $user    User to check against.
         */
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy($user), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>Error</strong>: Your account has been marked as a spammer.'));
        }
    }
    return $user;
}

WordPress Version: 4.6

/**
 * For Multisite blogs, check if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 *
 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
 */
function wp_authenticate_spam_check($user)
{
    if ($user instanceof WP_User && is_multisite()) {
        /**
         * Filters whether the user has been marked as a spammer.
         *
         * @since 3.7.0
         *
         * @param bool    $spammed Whether the user is considered a spammer.
         * @param WP_User $user    User to check against.
         */
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy($user), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
        }
    }
    return $user;
}

WordPress Version: 4.2

/**
 * For Multisite blogs, check if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 *
 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
 */
function wp_authenticate_spam_check($user)
{
    if ($user instanceof WP_User && is_multisite()) {
        /**
         * Filter whether the user has been marked as a spammer.
         *
         * @since 3.7.0
         *
         * @param bool    $spammed Whether the user is considered a spammer.
         * @param WP_User $user    User to check against.
         */
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy(), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
        }
    }
    return $user;
}

WordPress Version: 3.9

/**
 * For Multisite blogs, check if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 *
 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
 */
function wp_authenticate_spam_check($user)
{
    if ($user && is_a($user, 'WP_User') && is_multisite()) {
        /**
         * Filter whether the user has been marked as a spammer.
         *
         * @since 3.7.0
         *
         * @param bool    $spammed Whether the user is considered a spammer.
         * @param WP_User $user    User to check against.
         */
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy(), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
        }
    }
    return $user;
}

WordPress Version: 3.7

/**
 * For multisite blogs, check if the authenticated user has been marked as a
 * spammer, or if the user's primary blog has been marked as spam.
 *
 * @since 3.7.0
 */
function wp_authenticate_spam_check($user)
{
    if ($user && is_a($user, 'WP_User') && is_multisite()) {
        $spammed = apply_filters('check_is_user_spammed', is_user_spammy(), $user);
        if ($spammed) {
            return new WP_Error('spammer_account', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
        }
    }
    return $user;
}