fix comment @

pull/144/head
spirit 2019-11-27 23:56:26 +08:00
parent b770426ce1
commit c8349d33e9
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ if(akina_option('classify_display')){
*/
function comment_add_at( $comment_text, $comment = '') {
if( $comment->comment_parent > 0) {
$comment_text = '<a href="#comment-' . $comment->comment_parent . '" class="comment-at">@'.get_comment_author( $comment->comment_parent ) . '</a>&nbsp;' . $comment_text;
if(substr($comment_text, 0, 3) === "<p>")
$comment_text = str_replace(substr($comment_text, 0, 3), '<p><a href="#comment-' . $comment->comment_parent . '" class="comment-at">@'.get_comment_author( $comment->comment_parent ) . '</a>&nbsp;', $comment_text);
else $comment_text = '<a href="#comment-' . $comment->comment_parent . '" class="comment-at">@'.get_comment_author( $comment->comment_parent ) . '</a>&nbsp;' . $comment_text;
}
return $comment_text;
}