返回介绍

wp_authenticate_spam_check()

发布于 2017-09-11 11:34:10 字数 2009 浏览 1055 评论 0 收藏 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.


description


参数

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

更新日志

Versiondescription
3.7.0Introduced.

相关函数

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文