#wordpress 2025-09-07

2025-09-07 UTC
[Al_Abut] joined the channel
#
[asuh]
same, a little change here and there.
#
[asuh]
As I continue iterating, and then checking against the Webmention version of `Comment_Walker`, I’m seeing a lot of methods that I haven’t manually recreated in my own class. I’m realizing I don’t want to duplicate all of `Comment_Walker` and its methods. Instead, what I’m mostly interested in is the code inside of `html5_comment` that I can slightly rearrange the markup, and you’ll see what I’ve done in my code above. It’
#
[asuh]
GWG, that’s very kind. Here’s where I am for the current Comments class in my own theme work.
[snarfed] joined the channel
#
GWG-
You don't need to, that is what inheritance is for
#
[asuh]
So as long as I extend Webmention’s class, I can target `html5_comment` directly?
#
[asuh]
Something like this?
#
[asuh]
```<?php
#
[asuh]
class My_Comment_Walker extends Comment_Walker {
#
[asuh]
namespace MyTheme;
#
[asuh]
use Webmention\Comment_Walker;
#
[asuh]
protected function html5_comment( $comment, $depth, $args ) {
#
[asuh]
/** My code here **/
#
GWG-
Why not? Then you get everything
sebbu2 joined the channel
#
[asuh]
Thanks for the validation. In order to be safe, it looks necessary for me to add a conditional check for the plugin to be active, which means I can’t have a `use` statement. Thus:
#
[asuh]
```<?php
#
[asuh]
if ( class_exists( '\Webmention\Comment_Walker' ) ) {
#
[asuh]
class My_Comment_Walker extends \Webmention\Comment_Walker {
#
[asuh]
namespace MyTheme;
#
[asuh]
// My code here
#
[asuh]
protected function html5_comment( $comment, $depth, $args ) {
[marksuth], [schmarty], duanin2, [social], _123nick[d], [artlung] and Zegnat joined the channel
#
[morganm]
Hello, welcome (to myself) 😉
#
[morganm]
I have no context or review of this : https://developer.wordpress.com/studio/ . Ive been asked to work on a wordpress site and Ive been suggested this tool
#
[morganm]
Its a wordpress dot com thing? So maybe has some caveats like anything but just curious if there was any strong immediate reaction
gRegor and duanin2 joined the channel