wp_authenticate_spam_check() - WordPress 函数参考中文文档

返回介绍

wp_authenticate_spam_check()

发布于 2017-09-11 字数2011 浏览 985 评论 0

wp_authenticate_spam_check( WP_User|WP_Error|null $user )

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.


描述


参数

$user

(WP_User|WP_Error|null)
(Required)
WP_User or WP_Error object from a previous callback. Default null.


返回值

(WP_User|WP_Error) WP_User on success, WP_Error if the user is considered a spammer.


源代码

File: wp-includes/user.php

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

更新日志

Version 描述
3.7.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/load.php:
    is_multisite()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/user.php:
    check_is_user_spammed
  • wp-includes/ms-functions.php:
    is_user_spammy()
  • wp-includes/class-wp-error.php:
    WP_Error::__construct()
  • Show 1 more use
    Hide more uses


User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!