我想我会用get_image_tag
过滤器-它为您提供作为参数之一的大小。大致如下:
function wrap_wide_image_tags($html, $id, $alt, $title, $align, $size) {
if($size == \'wide-image\') {
$html = \'<div class="wrap-wide-image">\'.$html.\'</div>\';
}
return $html;
}
add_filter(\'get_image_tag\', \'wrap_wide_image_tags\', 10, 6);
希望这有帮助!