Skip to content

Commit a482c90

Browse files
committed
show avatars on likes and announces
thanks @janboddez
1 parent 7a19bde commit a482c90

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

assets/css/activitypub-admin.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,13 @@ input.blog-user-identifier {
202202
content: "\f307";
203203
font-family: dashicons;
204204
}
205+
206+
.repost .dashboard-comment-wrap,
207+
.like .dashboard-comment-wrap {
208+
padding-inline-start: 63px;
209+
}
210+
211+
.repost .dashboard-comment-wrap .comment-author,
212+
.like .dashboard-comment-wrap .comment-author {
213+
margin-block: 0;
214+
}

includes/class-comment.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public static function init() {
2525
\add_filter( 'comment_class', array( self::class, 'comment_class' ), 10, 3 );
2626
\add_filter( 'get_comment_link', array( self::class, 'remote_comment_link' ), 11, 3 );
2727
\add_action( 'wp_enqueue_scripts', array( self::class, 'enqueue_scripts' ) );
28+
29+
\add_filter( 'get_avatar_comment_types', array( static::class, 'get_avatar_comment_types' ), 99 );
2830
}
2931

3032
/**
@@ -576,4 +578,18 @@ public static function register_comment_types() {
576578
)
577579
);
578580
}
581+
582+
/**
583+
* Show avatars on Activities if set
584+
*
585+
* @param array $types list of avatar enabled comment types
586+
*
587+
* @return array show avatars on Activities
588+
*/
589+
public static function get_avatar_comment_types( $types ) {
590+
$comment_types = self::get_comment_type_names();
591+
$types = array_merge( $types, $comment_types );
592+
593+
return array_unique( $types );
594+
}
579595
}

0 commit comments

Comments
 (0)