钩子文档

comments_popup_link_attributes

💡 云策文档标注

概述

comments_popup_link_attributes 是一个 WordPress 过滤器,用于修改评论链接的 HTML 属性。它允许开发者在显示评论链接时自定义属性,如添加类名或数据属性。

关键要点

  • 过滤器名称:comments_popup_link_attributes
  • 参数:$link_attributes(字符串类型,默认值为空)
  • 用途:过滤评论链接的属性,常用于增强前端样式或功能
  • 相关函数:comments_popup_link(),用于显示当前文章的评论链接
  • 引入版本:WordPress 2.5.0

📄 原文内容

Filters the comments link attributes for display.

Parameters

$link_attributesstring
The comments link attributes. Default empty.

Source

$link_attributes = apply_filters( 'comments_popup_link_attributes', $link_attributes );

Changelog

Version Description
2.5.0 Introduced.