WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#25674 closed feature request (duplicate)

Custom Comment Types - register_comment_type

Reported by: sc0ttkclark Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: Cc:

Description

We could port most of the Post Type handling internals like register_post_type > register_comment_type and get_post_type > get_comment_type which would make this implementation in core easier. We could also register the built-in types like comment/pingback etc

Then, comment_type could be implemented like post_type is in edit.php, for the comments page, and allow for the new comment types to be added into their own menus.

I love the potential of what Custom Comment Types can bring, but unfortunately not having an API to work with them can make it cumbersome to build with.

I can make a first pass at a patch on this if anyone is interested in moving this forward.

Change History (16)

#1 @greenshady
6 years ago

  • Cc justin@… added

I'm interested in it. I've done a few custom comment types, which would've been made immensely easier with a core API for working with them.

#2 @johnbillion
6 years ago

Same here. Custom comment types work; an API for them would rock.

(Not really related, but this was implemented recently: #18596)

#3 @sc0ttkclark
6 years ago

@johnbillion oh yes, that'll be great for even potentially more uses.

#4 @sc0ttkclark
6 years ago

I'm so glad I'm not alone! I'm going to start up a github repo for this, as it may require quite a few functions and testing. If anyone wants to join me in this endeavor, please just let me know via Twitter @scottkclark with your GitHub username or hit me up in #wordpress irc.freenode.net @sc0ttkclark

This can't be exclusively done through a plugin, but I'll develop it like that at first to make it easier to deal with the final patch and not have to patch-and-patch-and-patch to avoid staleness. I'll include instructions on what files need changes etc.

I don't think this will be ready for 3.8, but I'll definitely aim for 3.9 or 4.0.

#5 @sc0ttkclark
6 years ago

Repo spun up at https://github.com/sc0ttkclark/wp-custom-comment-types

Again, just ping me if you want commit access. I'm going to setup individual tasks as feature 'issues' this weekend.

#6 follow-up: @GaryJ
6 years ago

For those who have only just been introduced to the idea, can you please give some examples of what different types of custom comments there could be / what circumstances in which they might be used?

#7 in reply to: ↑ 6 @greenshady
6 years ago

Replying to GaryJ:

For those who have only just been introduced to the idea, can you please give some examples of what different types of custom comments there could be / what circumstances in which they might be used?

A fairly common one might be something like a "tweetback", which would be Twitter tweets mentioning a blog post. Basically, a plugin could register this comment type, set up appropriate labels, and even add a separate admin screen for managing tweetbacks.

Some reasons for being able to register the comment type are:

  • Standardized way for handling custom comment types.
  • Ability to more easily do different admin "stuff" with these comment types.
  • Easier theme integration.

On the last point, I'm most interested in this. Suppose I wanted to separate all comment types via jQuery tabs on a single post view in my theme. This is easily done right now. However, I have no way to grab the translated "Tweetback(s)" label to properly identify what type of comments go under that tab.

There are many other things you could do, but I just pulled that example out since it's usually the easiest for most people to understand.

#8 @johnbillion
6 years ago

Some things I've used custom comments for in the past:

  • Changelogs
  • Customer interaction logs
  • Editorial feedback

#9 @sc0ttkclark
6 years ago

A few things I've used custom comment types for:

  • Activity logs for a post type
  • Reviews + Ratings

#10 @sc0ttkclark
6 years ago

Just made a first pass at some of the internals, still a lot of work and testing to do, along with UI tweaks probably.

https://github.com/sc0ttkclark/wp-custom-comment-types

#11 @defries
6 years ago

  • Cc remkus@… added

#12 follow-up: @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12668.

#13 in reply to: ↑ 12 @johnbillion
6 years ago

Replying to SergeyBiryukov:

Duplicate of #12668.

Really? #12668 was closed as maybelater 20 months ago. This is the "later".

#14 @sc0ttkclark
6 years ago

Not a huge deal of we can just reopen that.

#15 @alex-ye
5 years ago

  • Cc nashwan.doaqan@… added

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


3 years ago

Note: See TracTickets for help on using tickets.