Skip to content

Commit c4cd6a5

Browse files
committed
Add filter to disable comments feed json
1 parent 188f280 commit c4cd6a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jsonfeed-wp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ function json_feed_links_extra( $args = array() ) {
8181
if ( is_singular() ) {
8282
$id = 0;
8383
$post = get_post( $id );
84-
if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
84+
$comments = apply_filters( 'jsonfeed_comments_feed_enable', true );
85+
if ( $comments && ( comments_open() || pings_open() || $post->comment_count > 0 ) ) {
8586
$title = sprintf( $args['singletitle'], get_bloginfo( 'name' ), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );
8687
$href = get_post_comments_feed_link( $post->ID, 'json' );
8788
}

0 commit comments

Comments
 (0)