From a80d38b8f14dc7cdb4b634205a02511a7355523c Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 9 Oct 2024 17:53:30 +0200 Subject: [PATCH] Add wpdc_join_discussion_link_html filter (#533) --- lib/discourse-comment-formatter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/discourse-comment-formatter.php b/lib/discourse-comment-formatter.php index 076e0910..9dbd24ff 100644 --- a/lib/discourse-comment-formatter.php +++ b/lib/discourse-comment-formatter.php @@ -139,7 +139,7 @@ public function format( $post_id, $perform_sync = true, $force_sync = false, $co $comment_html = str_replace( '{comment_body}', $comment_body, $comment_html ); $comment_html = str_replace( '{comment_created_at}', $this->format_date( $post->created_at, $datetime_format ), $comment_html ); $comments_html .= $comment_html; - $displayed_comment_number++; + ++$displayed_comment_number; } foreach ( $participants as $participant ) { $participant_html = wp_kses_post( Templates::participant_html() ); @@ -213,7 +213,8 @@ public function comment_link( $post_id ) { } $link_text = apply_filters( 'wpdc_join_discussion_link_text', $link_text, $comments_count, $post_id ); - - return '
' . esc_html( $link_text ) . '
'; + $link_html = '
' . esc_html( $link_text ) . '
'; + $link_html = apply_filters( 'wpdc_join_discussion_link_html', $link_html, $discourse_permalink, $new_tab, $link_text ); + return $link_html; } }