钩子文档

comment_author_link_rel

💡 云策文档标注

概述

comment_author_link_rel 是一个 WordPress 过滤器,用于修改评论作者链接的 rel 属性。它允许开发者自定义链接的 rel 标签,以增强 SEO 或安全性。

关键要点

  • 过滤器名称:comment_author_link_rel
  • 参数:$rel_parts(字符串数组,表示 rel 标签)和 $comment(WP_Comment 对象)
  • 用途:在 get_comment_author_link() 函数中调用,控制评论作者链接的 rel 属性
  • 引入版本:WordPress 6.2.0

代码示例

$rel_parts = apply_filters( 'comment_author_link_rel', $rel_parts, $comment );

📄 原文内容

Filters the rel attributes of the comment author’s link.

Parameters

$rel_partsstring[]
An array of strings representing the rel tags which will be joined into the anchor’s rel attribute.
$commentWP_Comment
The comment object.

Source

$rel_parts = apply_filters( 'comment_author_link_rel', $rel_parts, $comment );

Changelog

Version Description
6.2.0 Introduced.