site_admin_email_change_email
云策文档标注
概述
site_admin_email_change_email 是一个 WordPress 过滤器,用于自定义站点管理员邮箱地址变更时发送的邮件通知内容。它允许开发者修改邮件的收件人、主题、正文和头部信息。
关键要点
- 过滤器名称:site_admin_email_change_email
- 用途:过滤站点管理员邮箱变更通知邮件的构建参数
- 参数:$email_change_email(数组,包含 to、subject、message、headers 等键),$old_email(旧邮箱地址),$new_email(新邮箱地址)
- 动态替换字符串:###OLD_EMAIL###、###NEW_EMAIL###、###SITENAME###、###SITEURL### 可在邮件内容中自动替换为相应值
- 相关函数:wp_site_admin_email_change_notification() 用于发送邮件
- 引入版本:WordPress 4.9.0
代码示例
$email_change_email = apply_filters( 'site_admin_email_change_email', $email_change_email, $old_email, $new_email );
原文内容
Filters the contents of the email notification sent when the site admin email address is changed.
Parameters
$email_change_emailarray-
Used to build wp_mail() .
tostringThe intended recipient.subjectstringThe subject of the email.messagestringThe content of the email.
The following strings have a special meaning and will get replaced dynamically:###OLD_EMAIL###The old site admin email address.###NEW_EMAIL###The new site admin email address.###SITENAME###The name of the site.###SITEURL###The URL to the site.
headersstringHeaders.
$old_emailstring-
The old site admin email address.
$new_emailstring-
The new site admin email address.
Source
$email_change_email = apply_filters( 'site_admin_email_change_email', $email_change_email, $old_email, $new_email );
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |