wp_send_new_user_notification_to_admin
云策文档标注
概述
wp_send_new_user_notification_to_admin 是一个 WordPress 过滤器,用于控制是否向管理员发送新用户注册通知邮件。它允许开发者根据条件动态调整通知行为。
关键要点
- 这是一个过滤器,用于管理新用户注册时是否通知管理员。
- 接受两个参数:$send(布尔值,默认 true)和 $user(WP_User 对象)。
- 在 wp_new_user_notification() 函数中被调用,用于发送登录凭证邮件。
- 从 WordPress 6.1.0 版本开始引入。
原文内容
Filters whether the admin is notified of a new user registration.
Parameters
$sendbool-
Whether to send the email. Default true.
$userWP_User-
User object for new user.
Source
$send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user );
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |