new_admin_email_content
云策文档标注
概述
new_admin_email_content 是一个 WordPress 过滤器,用于自定义尝试更改站点管理员电子邮件地址时发送的邮件内容。它允许开发者修改邮件文本,并支持动态替换特定占位符。
关键要点
- 过滤器名称:new_admin_email_content
- 用途:过滤站点管理员电子邮件更改确认邮件的文本内容
- 动态占位符:###USERNAME###(当前用户名)、###ADMIN_URL###(确认链接)、###EMAIL###(新邮件地址)、###SITENAME###(站点名称)、###SITEURL###(站点URL)
- 参数:$email_text(邮件文本字符串)、$new_admin_email(包含新邮件地址数据的数组)
- 相关函数:update_option_new_admin_email() 用于发送确认请求邮件
- 引入版本:WordPress 4.9.0(MU 3.0.0)
代码示例
$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
原文内容
Filters the text of the email sent when a change of site admin email address is attempted.
Description
The following strings have a special meaning and will get replaced dynamically:
###USERNAME###The current user’s username.###ADMIN_URL###The link to click on to confirm the email change.###EMAIL###The proposed new site admin email address.###SITENAME###The name of the site.###SITEURL###The URL to the site.
Parameters
$email_textstring-
Text in the email.
$new_admin_emailarray-
Data relating to the new site admin email address.
hashstringThe secure hash used in the confirmation link URL.newemailstringThe proposed new site admin email address.
Source
$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | MU (3.0.0) |
| 4.9.0 | Introduced. |