wpmu_signup_blog_notification
云策文档标注
概述
wpmu_signup_blog_notification 是一个 WordPress 过滤器,用于控制是否绕过新站点注册时的电子邮件通知。它允许开发者根据条件决定是否发送确认邮件。
关键要点
- 这是一个过滤器,用于管理新站点注册的电子邮件通知发送逻辑。
- 接受多个参数,包括站点域名、路径、标题、用户登录名、邮箱、激活键和元数据。
- 返回 false 可以阻止邮件发送,否则正常发送通知。
代码示例
if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) {
// 如果过滤器返回 false,则跳过邮件发送
}注意事项
- 此过滤器在 WordPress MU 3.0.0 版本中引入,适用于多站点环境。
- 与 wpmu_signup_blog_notification() 函数相关,该函数负责发送确认邮件。
- 元数据参数默认包含隐私设置和语言 ID,可用于自定义过滤逻辑。
原文内容
Filters whether to bypass the new site email notification.
Parameters
$domainstring|false-
Site domain, or false to prevent the email from sending.
$pathstring-
Site path.
$titlestring-
Site title.
$user_loginstring-
User login name.
$user_emailstring-
User email address.
$keystring-
Activation key created in wpmu_signup_blog() .
$metaarray-
Signup meta data. By default, contains the requested privacy setting and lang_id.
Source
if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) {
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |