From e6473db4f8c028187c73ea89e49bb7b6d8eccc7c Mon Sep 17 00:00:00 2001 From: Django Doucet Date: Fri, 27 Oct 2023 09:16:29 -0600 Subject: [PATCH] Link to comment source as row action --- includes/class-admin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/includes/class-admin.php b/includes/class-admin.php index 59e1b48..ac121f1 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -287,6 +287,17 @@ class Admin { $summary, \__( 'Reply', 'activitypub' ) ); + $remote_comment_link = get_comment_meta( $comment->comment_ID, 'source_url', true ); + if ( $remote_comment_link ) { + $comment_link = esc_url( $remote_comment_link ); + $source_link = '%s'; + $actions['source'] = \sprintf( + $source_link, + $comment_link, + \esc_attr__( 'View this comment on remote server', 'activitypub' ), + \__( 'View source', 'activitypub' ) + ); + } return $actions; }