#28129 closed enhancement (duplicate)
Add filter for wp_list_comments() arguments
| Reported by: |
|
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.
Adding 'wp_list_comments_args' filter