当前位置:首页 > 云计算 > 正文内容

WordPress获取文章评论Feed链接函数:get_post_comments_feed_link

2022-05-31 08:14:57云计算6

WordPress函数get_post_comments_feed_link用于获取指定文章评论的Feed链接地址,与post_comments_feed_link()函数不同,get_post_comments_feed_link()函数只返回链接地址,而post_comments_feed_link()函数首先使用get_post_comments_feed_link()获取到链接,再输出超链接标签。

get_post_comments_feed_link( int $post_id, string $feed = '' )

函数参数

$post_id

整数

文章ID,如果不指定,则输出当前文章的评论链接。

$feed

字符串

Feed的类型,可用值:rss2、atom,默认值为get_default_feed()函数返回的值,即rss2

函数返回值

https://www.tiezhushuo.com/3775.html/feed

函数使用示例

<a href="<?php echo get_post_comments_feed_link();?>">评论Feed</a>

扩展阅读

get_post_comments_feed_link()函数位于:wp-includes/link-template.php

相关函数:

  • post_comments_feed_link()
  • post_comments_feed_link_html()
  • comments_rss_link()

本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.

本文链接:https://www.xibujisuan.cn/22797.html

标签: WordPress