Skip to content

Commit c0d09bd

Browse files
committed
Allow "Approve & Always Allow" only for Webmentions
This fails on other comment types like for example ActivityPub: Automattic/wordpress-activitypub#865
1 parent 3f60485 commit c0d09bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

includes/class-admin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,17 @@ public static function comment_row_actions( $actions, $comment ) {
195195

196196
$approve_url = admin_url( 'comment.php' );
197197
$approve_url = add_query_arg( $query, $approve_url );
198+
$status = wp_get_comment_status( $comment );
199+
$protocol = get_comment_meta( $comment->comment_ID, 'protocol' );
200+
201+
if ( ! $protocol || ! in_array( 'webmention', $protocol, true ) ) {
202+
return $actions;
203+
}
198204

199-
$status = wp_get_comment_status( $comment );
200205
if ( 'unapproved' === $status ) {
201206
$actions['domainapprovelist'] = sprintf( '<a href="%1$s" aria-label="%2$s">%2$s</a>', esc_url( $approve_url ), esc_attr__( 'Approve & Always Allow', 'webmention' ) );
202207
}
208+
203209
return $actions;
204210
}
205211

0 commit comments

Comments
 (0)