Skip to content
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

Merged
merged 12 commits into from
Aug 22, 2024

Conversation

sksaju
Copy link
Member

@sksaju sksaju commented Mar 10, 2024

Description of the Change

Closes #152

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @username, @username2, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@sksaju sksaju requested a review from darylldoyle March 10, 2024 20:28
@sksaju
Copy link
Member Author

sksaju commented Mar 10, 2024

@darylldoyle I've removed comments support from every post type, but please let me know if it should be specified! Thanks

Copy link
Contributor

@darylldoyle darylldoyle left a 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 🤔

@sksaju
Copy link
Member Author

sksaju commented Mar 25, 2024

@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 sksaju requested a review from darylldoyle March 25, 2024 09:57
includes/classes/Comments/Comments.php Outdated Show resolved Hide resolved
includes/classes/Comments/Comments.php Outdated Show resolved Hide resolved
@sksaju sksaju requested a review from darylldoyle April 1, 2024 13:35
@claytoncollie
Copy link
Contributor

@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

@claytoncollie
Copy link
Contributor

@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.

@darylldoyle
Copy link
Contributor

@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)

@claytoncollie
Copy link
Contributor

@darylldoyle Very nice. Thank you for the additions.

@darylldoyle darylldoyle dismissed their stale review August 22, 2024 14:14

taking over

@darylldoyle darylldoyle merged commit d1349fd into develop Aug 22, 2024
5 checks passed
@darylldoyle darylldoyle deleted the feature/152-disable-comments-and-comments-ui branch August 22, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request - Disable comments and comments UI
4 participants