Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#34362 closed feature request (duplicate)

Improvements to comment_type function

Reported by: dshanske's profile dshanske Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords: needs-patch reporter-feedback
Focuses: Cc:


comment_type should have a filter for non-standard comment types, and should have, as other functions do, an option to return the text, as opposed to echoing it.

Attachments (1)

34362.diff (2.0 KB) - added by jgrodel 9 years ago.

Download all attachments as: .zip

Change History (9)

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

9 years ago

#2 @rachelbaker
9 years ago

  • Type changed from defect (bug) to feature request

Related #12668

#3 @rachelbaker
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

9 years ago

#4 @jgrodel
9 years ago

Just a quick first attempt. Feedback welcome.


Last edited 9 years ago by jgrodel (previous) (diff)

#5 @rachelbaker
8 years ago

  • Keywords reporter-feedback added

@dshanske get_comment_type() already allows you to just get the comment_type (without echoing it), can you provide some details around why this other function wouldn't fit your use-case?
I agree that the comment_type is very inflexible, and I like the idea of adding a filter here, but I don't like the idea of adding a fourth parameter.

#6 @dshanske
8 years ago

@rachelbaker I didn't write the patch. My original point was that there wasn't consistency in the functions compared to similar functions.

My use case was custom comment types. But get_commment_type allows you to get the name of the type, not the presentation name. For example...

'pingback' may be the comment type, but the presentation name might be Pingback or whatever in another language.

Personally, I'd like to deprecate the first three parameters in favor of a filter, but that leads to backward compatibility issues.

#7 @rachelbaker
8 years ago

@dshanske I think what really needs to happen here is full support for comment types, like we have with Posts. See #35214

#8 @rachelbaker
8 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #35214.

Note: See TracTickets for help on using tickets.