update_welcome_email
云策文档标注
概述
update_welcome_email 是一个 WordPress 过滤器钩子,用于修改站点激活后发送给管理员的欢迎邮件内容。它允许开发者自定义邮件正文,并提供了多个参数来访问站点和用户信息。
关键要点
- update_welcome_email 是一个过滤器钩子,用于过滤欢迎邮件的消息体。
- 邮件内容应格式化为适合 wp_mail() 传输的格式。
- 钩子接收多个参数:$welcome_email(邮件正文)、$blog_id(站点ID)、$user_id(管理员用户ID)、$password(用户密码或“N/A”)、$title(站点标题)和$meta(注册元数据)。
- 在 WordPress MU 3.0.0 版本中引入,主要用于多站点环境。
- 相关函数 wpmu_welcome_notification() 用于发送站点激活成功的通知。
原文内容
Filters the content of the welcome email sent to the site administrator after site activation.
Description
Content should be formatted for transmission via wp_mail() .
Parameters
$welcome_emailstring-
Message body of the email.
$blog_idint-
Site ID.
$user_idint-
User ID of the site administrator.
$passwordstring-
User password, or “N/A” if the user account is not new.
$titlestring-
Site title.
$metaarray-
Signup meta data. By default, contains the requested privacy setting and lang_id.
Source
$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |