钩子文档

wp_new_user_notification_email_admin

💡 云策文档标注

概述

wp_new_user_notification_email_admin 是一个 WordPress 过滤器,用于自定义发送给站点管理员的新用户通知邮件内容。它允许开发者修改邮件的收件人、主题、正文和头部信息。

关键要点

  • 这是一个过滤器钩子,用于修改新用户注册时发送给管理员的邮件内容。
  • 参数包括一个数组(用于构建 wp_mail())、用户对象和站点标题。
  • 通过 apply_filters 调用,开发者可以添加自定义函数来调整邮件属性。

代码示例

$wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );

注意事项

  • 该过滤器在 WordPress 4.9.0 版本中引入。
  • 相关函数 wp_new_user_notification() 用于向新注册用户发送登录凭据邮件。

📄 原文内容

Filters the contents of the new user notification email sent to the site admin.

Parameters

$wp_new_user_notification_email_adminarray
Used to build wp_mail() .

  • to string
    The intended recipient – site admin email address.
  • subject string
    The subject of the email.
  • message string
    The body of the email.
  • headers string
    The headers of the email.

$userWP_User
User object for new user.
$blognamestring
The site title.

Source

$wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );

Changelog

Version Description
4.9.0 Introduced.