WordPress回复评论时@原评论者的教程

在回复别人评论的时候,可以用此函数@别人,明确回复的是谁。

将下列函数放到主题的functions.php即可。

// 评论@回复  
function idevs_comment_add_at( $comment_text, $comment = '') {  
    if( $comment->comment_parent > 0) {  
        $comment_text = '@<a href="#comment-' . $comment->comment_parent . '">'.get_comment_author( $comment->comment_parent ) . '</a> ' . $comment_text;  
    }  
return $comment_text;  
}  
add_filter( 'comment_text' , 'idevs_comment_add_at', 20, 2); 

👋 感谢您的观看!

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享