wordpress-webmention
                                
                                 wordpress-webmention copied to clipboard
                                
                                    wordpress-webmention copied to clipboard
                            
                            
                            
                        Implement Custom Comment Walker
Semantic Linkbacks has a custom comment walker that changes comment displays to support extra parameters.
I want to move this into webmentions and reimplement it. But, as noted in a request in that plugin, it needs to easily allow theme customization of displays.
It needs to have a few parameters. This is based on a theme calling wp_list_comments
- 
Since this is a Walker, if there is a callback, that would have to take precedence. 
- 
The Walker should call a handler that uses individual template files in the plugin that can be overidden by placing a file in the theme. 
- 
There should be accounting for two different presentations, triggered by the short_ping setting. Short ping would be the short presentation. 
Do we really need a comment walker? In semantic linkbacks it is, as far as I understood it, only because we have not really implemented emoji support to the parser.
Well, the walker would handle webmention display... initially just text, but ultimately the Facepile and other options.
Currently it works without... any advantage over the current version?
I am trying to figure out how to move Semantic Linkbacks pieces over without disruption.
So, this piece does exist in that plugin
We have multiple requests related to presentation that this would cover... different presentation types
But the comment walker does not handle the custom comment-types... it only handles the emojis and this was a hack, that is why I am challenging the need of the walker...
The comment walker handled the replies. It displayed them marked up with mf2. You disabled that on your theme, I believe
Looking at how WordPress handles this. Assuming themes use wp_list_comments...the function offers the option to call an alternate walker or a custom callback function.
But the custom callback function is passed to the comment walker. So, if we use the 'wp_list_comments_args' filter to pass a custom comment walker, that comment walker would decide whether to load the custom callback function.
So, the proposed logic would be as follows.
- Filter loads walker at a low priority, so anything higher would override, which gives other plugins freedom to do what they want.
- Add a filter that would allow different callbacks to be loaded based on comment type.
- There are two options for handling the type 'comment'. One is only getting involved if it is protocol=webmention to present additional info if it is a webmention reply. Second is to take over all comments in order to add microformats 2 markup, but have it look almost exactly like the existing one.
- If a custom callback is requested in the wp_list_comment arguments, that would override this handling.
@pfefferle Thoughts?
I think it is a good plan to start but I would skip the comment template overwriting in the first release and fokus on grouping of the comment types. I would also add an option to disable the whole comment-display section, to be able to implement "native" support in themes.
I'm thinking about this... https://core.trac.wordpress.org/ticket/31282
I added in this https://core.trac.wordpress.org/ticket/55470 to Core, which I thought might help, based on my solution.