钩子文档

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() .

  • to string
    The email address of the recipient.
  • subject string
    The subject of the email.
  • message string
    The content of the email.
  • headers string
    Headers.

$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.