钩子文档

get_comment_link

💡 云策文档标注

概述

get_comment_link 是一个 WordPress 过滤器,用于修改单个评论的固定链接。它允许开发者在返回评论链接时进行自定义处理。

关键要点

  • 过滤器名称:get_comment_link
  • 参数:$comment_link(评论链接字符串)、$comment(WP_Comment 对象)、$args(参数数组)、$cpage(计算出的 'cpage' 值)
  • 相关函数:get_comment_link() 用于检索给定评论的链接
  • 版本变更:4.4.0 版本添加了 $cpage 参数,2.8.0 版本引入

📄 原文内容

Filters the returned single comment permalink.

Description

See also

Parameters

$comment_linkstring
The comment permalink with '#comment-$id' appended.
$commentWP_Comment
The current comment object.
$argsarray
An array of arguments to override the defaults.
$cpageint
The calculated 'cpage' value.

Source

return apply_filters( 'get_comment_link', $comment_link, $comment, $args, $cpage );

Changelog

Version Description
4.4.0 Added the $cpage parameter.
2.8.0 Introduced.