钩子文档

user_request_confirmed_email_subject

💡 云策文档标注

概述

user_request_confirmed_email_subject 是一个 WordPress 过滤器钩子,用于修改用户请求确认邮件的主题。它允许开发者自定义邮件主题内容,基于站点名称和相关邮件数据。

关键要点

  • 这是一个过滤器钩子,用于过滤用户请求确认邮件的主题字符串。
  • 参数包括 $subject(邮件主题)、$sitename(站点名称)和 $email_data(包含请求对象、用户邮箱、操作描述等数据的数组)。
  • 钩子在 _wp_privacy_send_request_confirmation_notification() 函数中被调用,用于通知管理员请求已确认。
  • 自 WordPress 4.9.8 版本引入。

代码示例

$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );

📄 原文内容

Filters the subject of the user request confirmation email.

Parameters

$subjectstring
The email subject.
$sitenamestring
The name of the site.
$email_dataarray
Data relating to the account action email.

  • request WP_User_Request
    User request object.
  • user_email string
    The email address confirming a request.
  • description string
    Description of the action being performed so the user knows what the email is for.
  • manage_url string
    The link to click manage privacy requests of this type.
  • sitename string
    The site name sending the mail.
  • siteurl string
    The site URL sending the mail.
  • admin_email string
    The administrator email receiving the mail.

Source

$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );

Changelog

Version Description
4.9.8 Introduced.