函数文档

get_comment_author_rss()

💡 云策文档标注

概述

get_comment_author_rss() 函数用于在 RSS 或 Atom 等 feed 中检索当前评论的作者信息。它基于 get_comment_author() 函数,并通过 comment_author_rss 过滤器提供自定义能力。

关键要点

  • 函数返回字符串类型的评论作者名称,适用于 feed 输出。
  • 内部调用 get_comment_author() 获取作者,并使用 apply_filters() 应用 comment_author_rss 过滤器。
  • comment_author_rss 过滤器允许开发者修改 feed 中的评论作者显示,参数为 $comment_author。
  • 相关函数包括 get_comment_author() 和 comment_author_rss(),后者用于直接显示。
  • 自 WordPress 2.0.0 版本引入,无后续变更记录。

📄 原文内容

Retrieves the current comment author for use in the feeds.

Return

string Comment Author.

Source

function get_comment_author_rss() {
	/**
	 * Filters the current comment author for use in a feed.
	 *
	 * @since 1.5.0
	 *
	 * @see get_comment_author()
	 *
	 * @param string $comment_author The current comment author.
	 */
	return apply_filters( 'comment_author_rss', get_comment_author() );
}

Hooks

apply_filters( ‘comment_author_rss’, string $comment_author )

Filters the current comment author for use in a feed.

Changelog

Version Description
2.0.0 Introduced.