Skip to content

Commit

Permalink
Add wpdc_join_discussion_link_html filter (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod authored Oct 9, 2024
1 parent f6e6c50 commit a80d38b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/discourse-comment-formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down Expand Up @@ -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 '<div class="wpdc-join-discussion"><a class="wpdc-join-discussion-link" href="' . esc_url_raw( $discourse_permalink ) . '"' . $new_tab . '>' . esc_html( $link_text ) . '</a></div>';
$link_html = '<div class="wpdc-join-discussion"><a class="wpdc-join-discussion-link" href="' . esc_url_raw( $discourse_permalink ) . '"' . $new_tab . '>' . esc_html( $link_text ) . '</a></div>';
$link_html = apply_filters( 'wpdc_join_discussion_link_html', $link_html, $discourse_permalink, $new_tab, $link_text );
return $link_html;
}
}

0 comments on commit a80d38b

Please sign in to comment.