From 357bd80a0b14a8c2c0e9c6954e3b4ebe10c09ad1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 1 Sep 2015 02:45:58 +0000 Subject: [PATCH] Add filters to `feed_links()` to choose whether to display the links to posts feed and comments feed, separately. props joostdevalk, juliobox. fixes #23692. git-svn-id: https://develop.svn.wordpress.org/trunk@33838 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 8f2cdf67aa..7709c73db6 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2306,8 +2306,27 @@ function feed_links( $args = array() ) { $args = wp_parse_args( $args, $defaults ); - echo '\n"; - echo '\n"; + /** + * Filter whether to display the posts feed link. + * + * @since 4.3.0 + * + * @param bool $show Whether to display the posts feed link. Default true. + */ + if ( apply_filters( 'feed_links_show_posts_feed', true ) ) { + echo '\n"; + } + + /** + * Filter whether to display the comments feed link. + * + * @since 4.3.0 + * + * @param bool $show Whether to display the comments feed link. Default true. + */ + if ( apply_filters( 'feed_links_show_comments_feed', true ) ) { + echo '\n"; + } } /**