钩子文档

network_admin_email_change_email

💡 云策文档标注

概述

network_admin_email_change_email 是一个 WordPress 过滤器钩子,用于自定义网络管理员邮箱地址变更时发送的邮件通知内容。它允许开发者修改邮件的主题、正文、收件人等参数。

关键要点

  • 这是一个过滤器钩子,用于修改网络管理员邮箱变更邮件的构建数组。
  • 参数包括 $email_change_email(数组,用于构建 wp_mail())、$old_email(旧邮箱地址)、$new_email(新邮箱地址)和 $network_id(网络ID)。
  • 邮件内容支持动态替换字符串,如 ###OLD_EMAIL###、###NEW_EMAIL###、###SITENAME### 和 ###SITEURL###。
  • 相关函数为 wp_network_admin_email_change_notification(),在 wp-includes/ms-functions.php 中定义。
  • 该钩子自 WordPress 4.9.0 版本引入。

📄 原文内容

Filters the contents of the email notification sent when the network admin email address is changed.

Parameters

$email_change_emailarray
Used to build wp_mail() .

  • to string
    The intended recipient.
  • subject string
    The subject of the email.
  • message string
    The content of the email.
    The following strings have a special meaning and will get replaced dynamically:

    • ###OLD_EMAIL### The old network admin email address.
    • ###NEW_EMAIL### The new network admin email address.
    • ###SITENAME### The name of the network.
    • ###SITEURL### The URL to the site.
  • headers string
    Headers.

$old_emailstring
The old network admin email address.
$new_emailstring
The new network admin email address.
$network_idint
ID of the network.

Source

$email_change_email = apply_filters( 'network_admin_email_change_email', $email_change_email, $old_email, $new_email, $network_id );

Changelog

Version Description
4.9.0 Introduced.