feed_links_extra_show_post_comments_feed
云策文档标注
概述
本文档介绍 WordPress 中的 'feed_links_extra_show_post_comments_feed' 过滤器,用于控制是否显示单个文章的评论订阅链接,独立于全局评论订阅设置。
关键要点
- 该过滤器允许开发者基于每个文章独立启用或禁用评论订阅链接,不受 'feed_links_show_comments_feed' 过滤器(控制全局评论订阅)的影响。
- 参数 $show_comments_feed 是一个布尔值,默认值为 'feed_links_show_comments_feed' 过滤器的结果,用于决定是否显示链接。
- 此过滤器在 WordPress 6.1.0 版本中引入,常用于 feed_links_extra() 函数中,处理额外订阅链接如分类订阅。
原文内容
Filters whether to display the post comments feed link.
Description
This filter allows to enable or disable the feed link for a singular post in a way that is independent of ‘feed_links_show_comments_feed’ (which controls the global comments feed). The result of that filter is accepted as a parameter.
Parameters
$show_comments_feedbool-
Whether to display the post comments feed link. Defaults to the ‘feed_links_show_comments_feed’ filter result.
Source
$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |