[wp-trac] [WordPress Trac] #43298: Add filter to hide comment types from showing up in the default query
WordPress Trac
noreply at wordpress.org
Mon Feb 12 15:05:25 UTC 2018
#43298: Add filter to hide comment types from showing up in the default query
-------------------------+-----------------------------
Reporter: atimmer | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Comment types are not something WordPress supports by default. However,
there is some data and API support for it. The `wp_comments` table
contains a `comment_type` column which can be used for this purpose. The
big downside is that by default these will be shown in all comment
overview. Both on the frontend and the backend.
There are plugins that already do this. The examples that triggered this
ticket are
[https://github.com/woocommerce/woocommerce/blob/d2e9b366121166c7cb26936bd2c251f3dd7ebd5d/includes
/class-wc-comments.php#L110 WooCommerce] and
[https://github.com/WordPress/gutenberg/pull/4685/files#diff-
df5e27f1866a42a0c24ae7c0b17b1bc6R496 this PR on Gutenberg]. These plugins
use the `where` clause in the pieces of the query to make this possible.
I propose we add a 'simple' filter that can hide specific comment types
from view. If `comment_type` is not queried in any other way, this
blacklist will make sure that all comment types in the blacklist are not
returned from the query.
'''Why not wait for full comment_type support?'''
Full `comment_type` support is a much bigger effort. This filter would
benefit us in the short run and doesn't conflict with full `comment_type`
support.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43298>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list