-
add_action('comment_text', 'comments_embed_img', 2); -
function comments_embed_img( $comment ) { -
$size = auto; -
$comment = preg_replace( array ('#(http: //([^\s]*)\. (jpg|gif|png|JPG|GIF|PNG))#','#(https://([^\s]*)\. (jpg | gif | png | JPG | GIF | PNG)) # '),'<img src="$1" alt="comment" style="width: '. $size.'; height: '. $size.'"/>', $comment); -
return $comment ; -
}
![weinxin](https://zmingcx.com/wp-content/uploads/2019/08/wx.png)