Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#28129 closed enhancement (duplicate)

Add filter for wp_list_comments() arguments

Reported by: hlashbrooke's profile hlashbrooke Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Comments Keywords: has-patch
Focuses: template Cc:

Description

The arguments for wp_list_comments() cannot currently be filtered and the only way to modify them is by modifying the call in the comments.php template file. The problem with this is that if plugins add any custom comment types that are not meant to be displayed on the frontend, then there is no way of hiding those types from within the plugin.

My initial use cause for this is in Sensei - we add user lesson and course data as comments on the plugin's CPTs in order to track progress and grades, but these comments all show up on the frontend as normal comments in the default WordPress themes because those themes (and many others) do not specify the comment type when calling wp_list_comments(). However, I'm sure this is something that a number of other plugins struggle with.

My patch for this simply adds a filter to the wp_list_comments() arguments, so it will not affect any existing functionality and will make core just a little bit more customisable.

Attachments (1)

28129.diff (599 bytes) - added by hlashbrooke 12 years ago.
Adding 'wp_list_comments_args' filter

Download all attachments as: .zip

Change History (4)

@hlashbrooke
12 years ago

Adding 'wp_list_comments_args' filter

#1 @hlashbrooke
12 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
12 years ago

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

Duplicate of #19581.

#3 @hlashbrooke
12 years ago

Sorry - searched for an existing ticket, but couldn't find it. Nice to know I had the exact same solution :)

Note: See TracTickets for help on using tickets.