#wordpress 2025-09-06

2025-09-06 UTC
gotra, [morganm], angelo, ben_, DJ_[dj_je][d], _123nick[d], [Al_Abut]1, gRegorLove_, Kaja_, _Sigmundur_morko, [marksuth]1, [schmarty]1, ben, __Sigmundur_mork, catra, duanin2 and [asuh] joined the channel
#
[asuh]
After enabling the Webmention plugin, I want to understand the ability to override the parts of `Comment_Walker`.
#
[asuh]
I understand the priority being 5 for overwrites, but is it possible to override just the html5 markup inside of this class? For example, I want to keep a lot of the custom functionality of the walker within Webmentions, but I’d like my markup structure to be slightly different. Is it possible to target just parts of `html5_comment` function?
Xander joined the channel
#
[artlung]
[asuh] I think the answer is yes. I'll describe my *specific* usage. I have a class I call `Roanoke_Walker_Comment` which extends the default WordPress `Walker_Comment` class to do the comment. I have code to display comments how I want - like you - I get the markup that works for my usage, and also enable the JS functions which allow replying to a comment in a threaded manner - `wp_enqueue_script('comment-reply')`
#
[artlung]
So when I show my comments it's this code:
#
[artlung]
```wp_list_comments(
#
[artlung]
// TODO determine if WebMention is the problem
#
[artlung]
'walker' => new Roanoke_Walker_Comment(),
#
[artlung]
// 'callback' => 'roanoke_wp_list_comments_callback',
#
[artlung]
'avatar_size' => 64,
#
[artlung]
// 'end-callback' => 'roanoke_wp_list_comments_end_callback',
#
[artlung]
'style' => 'div',
#
[artlung]
'html5' => true,
#
[artlung]
'short_ping' => false,
#
[artlung]
'echo' => true,
#
[artlung]
'reverse_top_level' => null,
#
[artlung]
you will note the callbacks I investigated which did run when I used them, but ended up not needing. hopefully useful to you!
Killeik, gRegorLove__, sa1, gRegorLove_ and [social] joined the channel
#
GWG-
The alternative comment walker in webmentions was designed to be easy to override
gotra and [manton] joined the channel
#
[asuh]
Thanks [artlung] , this is similar to what I’m trying, but an override of the webmentions comment walker also means having to recreate the various methods like `show_separated_reactions` or `comment_query`, among others. I’m trying to be specific about just overriding only `html5_comment`
#
[asuh]
GWG I know I’ve asked about overrides a few years ago so it’s appreciated that you updated this feature for overrides at all! I just want to see if I can be very tailored about which parts I override.
#
GWG-
[asuh]: If you want I could review and write something quickly
#
GWG-
I wrote the code to expand the stock implementation to allow different html5 comment functions per comment type with a back compatible syntax
#
GWG-
What do you want to do specifically?