-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable comments and comments related UI #154
Disable comments and comments related UI #154
Conversation
@darylldoyle I've removed comments support from every post type, but please let me know if it should be specified! Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sksaju thanks for your work on this! This is a great start, removing the UI elements from the admin, but this should also disable the comments form etc on the front end of the site.
See something like https://keithgreer.dev/wordpress-code-completely-disable-comments-using-functions-php/ for inspiration.
I also wonder if we should make it an option within the admin UI, whether they're enabled or not 🤔
Thanks for your feedback @darylldoyle, I've updated the PR, please retake a look. Thanks |
@sksaju @darylldoyle Is it too late to request an additional feature? It would be nice to provide a filter to set the option value as well as a wp-config constant to also set this value. Meaning that we can disable or enable comments in three places; wp-config, themes or plugins, and the wp-admin. I've done something similar in a personal plugin that might help explain the idea. https://github.com/claytoncollie/tracking-code-for-google-analytics/blob/master/inc/tracking-id.php |
@sksaju @darylldoyle Is this PR only to handle UI elements or be something a bit more comprehensive like some of the open source plugins? If more comprehensive, I suggest looking through the code from Uncomment. It is built by a 10upper, Barry Ceelen, and takes into account blocks, queries, UI, admin, and frontend. I have used it on a few sites and really like it. |
@claytoncollie, thanks for the feedback! Can you check if this now solves your concerns? I've added in logic to remove the comment blocks and widgets when comments are disabled and I've added a const and filter that allow you to disable it other ways (I appreciate the sample there) |
@darylldoyle Very nice. Thank you for the additions. |
Description of the Change
Closes #152
How to test the Change
Changelog Entry
Credits
Props @username, @username2, ...
Checklist: