我正在使用以下功能来检查 BuddyPress 注册时列入黑名单的电子邮件域.....
function bp_as_restrict_signup_domains( $email_blacklist_result ) {
$banned = array(
'test.com',
'spammer.com'
);
$error = 'Your email domain has been the source of spam. Please use another email address.';
$email = $email_blacklist_result['user_email'];
$domain = array_pop(explode('@', $email));
if ( in_array($domain, $banned))
{
$email_blacklist_result['errors']->add('user_email', __($error, 'bp-restrict-email-domains' ) );
};
return $email_blacklist_result;
}
add_filter( 'bp_core_validate_user_signup', 'bp_as_restrict_signup_domains' );
我想做的是向用户提供一些他们的电子邮件被拒绝的反馈,我如何向这个函数添加一个可以在模板中检索的变量?
像$bl_result = blacklisted
什么?