在functions.php里添加
//评论加图片
add_action('comment_text', 'comments_embed_img', 2);
function comments_embed_img($comment) {
$size = auto;
$comment = preg_replace(array('/\[img\]((http|https):\/\/\S*)\[\/img\]/'),'
', $comment);
return $comment;
}
在评论区添加的代码如下:
[img]在这里填写图片链接[/img]

举报 0