Link to comment source as row action

This commit is contained in:
Django Doucet 2023-10-27 09:16:29 -06:00
parent 375886b3de
commit e6473db4f8

View file

@ -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 = '<a href="%s" target="_blank" rel="no-referr" aria-label="%s">%s</a>';
$actions['source'] = \sprintf(
$source_link,
$comment_link,
\esc_attr__( 'View this comment on remote server', 'activitypub' ),
\__( 'View source', 'activitypub' )
);
}
return $actions;
}