WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 days ago

#35214 accepted task (blessed)

Custom Comment Types

Reported by: aaroncampbell Owned by: aaroncampbell
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: ui, administration, template Cc:

Description (last modified by SergeyBiryukov)

It's time to take another look at Custom Comment Types. We have a nice stable example in post types, but there's a lot to do here, so we'll use this as a centralized tracking ticket for everything. As such, I'm sure the description here will be fluid for a while as we figure out how much there is to do.

Here's a rough list of things that need to be looked at and addressed:

  • UI/UX - In order for custom comment types to be really useful, we need to put some serious thought into the UI/UX surrounding comments in the admin.
  • The comment_type field needs to start using 'comment' instead of '' for comments. This will mean an upgrade routine as well as some back-compat work.
  • We need to decide what to do about non-default comment types in various admin areas (comments table, recent comments, etc). The thing that makes most sense is for WP_Comment_Query to be adjusted to only show default comment types (comments, pingbacks, and trackbacks) by default. Additional comment types would then be handled by whatever plugin or theme adds them. Unfortunately, this is a breaking change (comment:58:ticket:12668) because right now those areas show all comment types. Maybe we can create new management areas to be able to pull these out of the default one? Lets put our heads together.
  • A lot of existing functions, like comment_type(), will need to be fixed to make room for newly registered comment types and their registered strings.

Previous tickets for history: #25674 #12668

Change History (20)

#1 @aaroncampbell
3 years ago

  • Owner set to aaroncampbell
  • Status changed from new to accepted

#2 @SergeyBiryukov
3 years ago

  • Description modified (diff)

#3 @Funkatronic
3 years ago

Would it make sense to to add comments as a sub menu to post types like taxonomies are currently?

#4 @rachelbaker
2 years ago

@aaroncampbell +1 to all the items in your rough list and suggestion to call on the prior art in post_type.

This ticket was mentioned in Slack in #core by rachelbaker. View the logs.


2 years ago

This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.


2 years ago

#8 @rachelbaker
2 years ago

  • Milestone changed from Future Release to 4.6

This ticket was mentioned in Slack in #core by rachelbaker. View the logs.


2 years ago

#10 @dshanske
2 years ago

What are the questions about the UI/UX?

This ticket was mentioned in Slack in #core-comments by rachelbaker. View the logs.


2 years ago

#12 @rachelbaker
2 years ago

Update: @aaroncampbell and I discussed how we can move forward with this ticket in the #core-comments Slack channel.

Summary:

The biggest issue with tackling this ticket remains the UI presentation.

Specifically answers to questions such as:

  • Should each custom comment type get it's own section within the WordPress dashboard menu, like registering a custom post type?
  • If we don't allow comment type menu sections, should all registered comment types be included in the current Comments list table? Or should there be different list tables for each custom comment type?

We are going to start with a proof of concept for an API that allows custom comment types to be registered, register_comment_type(), which borrows heavily from the prior art in register_post_type(). The proof of concept will begin as a plugin, already setup by @aaroncampbell on Github: https://github.com/aaroncampbell/custom-comment-types/ and the .org repo: https://wordpress.org/plugins/custom-comment-types/

#13 @rachelbaker
2 years ago

  • Milestone changed from 4.6 to Future Release

Punting out of 4.6.

#14 @rachelbaker
2 years ago

#34362 was marked as a duplicate.

#15 @rachelbaker
2 years ago

Related: #34110 - challenges with comment types and pagination

#16 @dshanske
23 months ago

Related: #34106 I think as part of the changes to comments necessary for custom comment types, we should implement comments having their own permalinks which will address some of the pagination issues.

#18 @dshanske
17 months ago

Was thinking about this, but being as custom comment types may have custom display needs, there needs to be a way to register a callback to handle display that can still be overridden by the usual methods.

Hoping that this project gets some interest as a future focus.

#19 @jaswrks
5 months ago

Example use case for custom comment types in Gutenberg. https://github.com/WordPress/gutenberg/pull/4685

I took a look at the GitHub repo mentioned in the ticket description. It seems like work has stalled on custom comment types? Or has it resumed in another ticket I'm unaware of?

In the use case for annotations in Gutenberg, others following this ticket might find it helpful to read over some conclusions I came to after work on an annotation API. I posted those thoughts here: https://github.com/WordPress/gutenberg/pull/4685#issuecomment-362785520

If Gutenberg annotations were implemented using a register_comment_type() extensibility feature in core, one of the most important considerations in private back-end annotations would be permissions. Like custom post types, it would be awesome if custom comment types supported the full range of meta-caps and the configuration of them.

This ticket was mentioned in Slack in #core-restapi by tharsheblows. View the logs.


3 days ago

Note: See TracTickets for help on using tickets.