wp_installed_email
云策文档标注
概述
wp_installed_email 是一个 WordPress 过滤器,用于自定义 WordPress 安装完成后发送给站点管理员的电子邮件内容。它允许开发者修改邮件的主题、正文、收件人地址等参数。
关键要点
- 过滤器名称:wp_installed_email
- 用途:过滤 WordPress 安装完成时发送给管理员的电子邮件内容
- 参数:$installed_email(数组,包含 to、subject、message、headers 等键),$user(WP_User 对象),$blog_title(站点标题),$blog_url(站点 URL),$password(管理员密码,通常为占位符)
- 相关函数:wp_new_blog_notification() 用于发送通知
- 引入版本:5.6.0
代码示例
$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );
原文内容
Filters the contents of the email sent to the site administrator when WordPress is installed.
Parameters
$installed_emailarray-
Used to build wp_mail() .
tostringThe email address of the recipient.subjectstringThe subject of the email.messagestringThe content of the email.headersstringHeaders.
$userWP_User-
The site administrator user object.
$blog_titlestring-
The site title.
$blog_urlstring-
The site URL.
$passwordstring-
The site administrator’s password. Note that a placeholder message is usually passed instead of the user’s actual password.
Source
$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );
Changelog
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |