Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Comment Count+Link shouldn't be displayed when comments aren't open #676

Closed
garretthyder opened this issue Nov 28, 2018 · 3 comments
Closed
Labels
wontfix This will not be worked on

Comments

@garretthyder
Copy link

Hello,

I noticed when using Disable Comments that disabling comments removed the feed but left behind the count link in the post meta block;
screen shot 2018-11-27 at 4 01 39 pm

This is because sites can potentially have comments left over in their DB even though they've disabled comments. The code used;
( comments_open() || get_comments_number() )
Should simply use comments_open and not check the comment count, like so;
comments_open()

This is found throughout the site for displaying the link or the comment template, in both cases if comments are closed they should be suppressed.

I'm going to follow this with a quick PR shortly.

Cheers

@joyously
Copy link

This is based on an incorrect assumption. What is correct is that comments should be displayed if they exist.
The Disable Comments option only turns off the ability to add new comments. The ones that are there should be shown. If comments are disabled, the comment form should not be shown, but the comments should.

@kjellr kjellr added the wontfix This will not be worked on label Nov 28, 2018
@kjellr
Copy link
Collaborator

kjellr commented Nov 28, 2018

Thank you for filing the issue, @garrett-eclipse!

The Disable Comments option only turns off the ability to add new comments. The ones that are there should be shown. If comments are disabled, the comment form should not be shown, but the comments should.

That's correct. Turning comments off does not typically hide existing comments — it just prevents new comments from being added. Since that's the case, I don't think it makes sense to hide the comment count in this case.

If a post has no comments, and comments are disabled, then the comment count will be hidden with the current setup.

Since this behavior is behaving as designed, I'm closing this as wontfix for now.

@kjellr kjellr closed this as completed Nov 28, 2018
@garretthyder
Copy link
Author

Thanks @joyously & @kjellr for pointing out the existing behaviour.

I see the conditional used matches the suggested convention here;
https://developer.wordpress.org/themes/template-files-section/partial-and-miscellaneous-template-files/comments/

It's too bad the existing convention makes it painful to strip comment functionality from themes when comments exist. I've had many clients get spammed to the point they want everything to do with comments hidden until they're able to clean them up. So I guess along with closing comments will have to filter get_comments_number to be 0 in order to suppress when comments exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants