comments_rss_link()
云策文档标注
概述
comments_rss_link() 是一个已弃用的 WordPress 函数,用于输出文章的评论 RSS 订阅链接。自 WordPress 2.5.0 起,建议使用 post_comments_feed_link() 替代。
关键要点
- 函数功能:打印文章的评论 RSS 订阅链接。
- 弃用状态:自 WordPress 2.5.0 起弃用,应改用 post_comments_feed_link()。
- 参数:接受一个可选的字符串参数 $link_text,用于指定链接文本,默认值为 'Comments RSS'。
- 相关函数:post_comments_feed_link() 是替代函数,_deprecated_function() 用于标记弃用。
代码示例
function comments_rss_link($link_text = 'Comments RSS') {
_deprecated_function( __FUNCTION__, '2.5.0', 'post_comments_feed_link()' );
post_comments_feed_link($link_text);
}注意事项
- 在开发中应避免使用此弃用函数,以保持代码兼容性和遵循最佳实践。
- 使用 post_comments_feed_link() 替代,以确保功能正常并支持未来版本。
原文内容
Print RSS comment feed link.
Description
See also
Parameters
$link_textstringrequired
Source
function comments_rss_link($link_text = 'Comments RSS') {
_deprecated_function( __FUNCTION__, '2.5.0', 'post_comments_feed_link()' );
post_comments_feed_link($link_text);
}
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Deprecated. Use post_comments_feed_link() |
| 1.0.1 | Introduced. |