Opened 6 years ago
Last modified 6 years ago
#44923 new enhancement
Filter .children class on nested comments list
Reported by: | greenshady | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The start_lvl()
method of Walker_Comment
should have a filter hook to customize the .children
class. This will allow theme authors to utilize their preferred system or CSS framework for handling nested comment lists. And, .children
is generic and requires writing nested CSS selectors to target it.
This change would put the comment walker on par with the nav menu walker, where we have the nav_menu_submenu_css_class
filter hook.
Attachments (2)
Change History (9)
This ticket was mentioned in Slack in #themereview by greenshady. View the logs.
6 years ago
#3
@
6 years ago
Yes, a filter is plenty when all you need to do is alter a class.
It sounds like the issues you're describing are out of scope for this proposed enhancement.
#5
@
6 years ago
I made a patch.
Because it is the first time, please let me know if there is a shortage.
I'm all for parity, but when I tried to make my menu work with CSS only, I had to insert elements at the parent level of the submenu, not at the child level. So while this filter would be good for comments, it would have the same problem of not being able to inject something at the parent level, which is how you have to work with CSS.
In my case, I had to supply an entire nav walker class just to output a small piece of HTML to be able to trigger the submenus. Comments are a bit less dynamic, but same nested lists.
What I'm saying is: is a filter enough?