钩子文档

user_request_action_email_headers

💡 云策文档标注

概述

user_request_action_email_headers 是一个 WordPress 过滤器钩子,用于修改用户账户操作确认邮件发送时的邮件头信息。它允许开发者在发送账户操作相关邮件时自定义邮件头,如发件人、回复地址等。

关键要点

  • 这是一个过滤器钩子,用于过滤账户操作确认邮件的邮件头。
  • 钩子名称:user_request_action_email_headers。
  • 参数包括:$headers(邮件头,字符串或数组)、$subject(邮件主题)、$content(邮件内容)、$request_id(请求ID)、$email_data(账户操作邮件相关数据)。
  • 在 wp_send_user_request() 函数中被调用,用于发送用户请求确认邮件。
  • 自 WordPress 5.4.0 版本引入。

📄 原文内容

Filters the headers of the email sent when an account action is attempted.

Parameters

$headersstring|array
The email headers.
$subjectstring
The email subject.
$contentstring
The email content.
$request_idint
The request ID.
$email_dataarray
Data relating to the account action email.

  • request WP_User_Request
    User request object.
  • email string
    The email address this is being sent to.
  • description string
    Description of the action being performed so the user knows what the email is for.
  • confirm_url string
    The link to click on to confirm the account action.
  • sitename string
    The site name sending the mail.
  • siteurl string
    The site URL sending the mail.

Source

$headers = apply_filters( 'user_request_action_email_headers', $headers, $subject, $content, $request_id, $email_data );

Changelog

Version Description
5.4.0 Introduced.