comment_notification_headers
云策文档标注
概述
comment_notification_headers 是一个 WordPress 过滤器钩子,用于修改评论通知邮件的头部信息。它允许开发者自定义邮件头,如发件人、回复地址等,以增强通知功能。
关键要点
- 这是一个过滤器钩子,用于过滤评论通知邮件的头部。
- 接受两个参数:$message_headers(邮件头部字符串)和 $comment_id(评论 ID 作为数字字符串)。
- 在 wp_notify_postauthor() 函数中被调用,用于通知文章作者或其他用户关于评论、trackback 或 pingback。
- 自 WordPress 1.5.2 版本引入。
原文内容
Filters the comment notification email headers.
Parameters
$message_headersstring-
Headers for the comment notification email.
$comment_idstring-
Comment ID as a numeric string.
Source
$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
Changelog
| Version | Description |
|---|---|
| 1.5.2 | Introduced. |