您需要使用过滤器image_send_to_editor
.
add_filter(\'image_send_to_editor\', \'wpse_62869_img_wrapper\', 20, 8);
function wpse_62869_img_wrapper( $html, $id, $caption, $title, $align, $url, $size, $alt )
{
return $html;
}
这些是测试插入的值,您可以使用它们来构建自己的
$html
回答
html | <a href="http://wp34.dev/wp-content/uploads/2012/11/escritorio.jpg"><img src="http://wp34.dev/wp-content/uploads/2012/11/escritorio-224x300.jpg" alt="Alt text for the image" title="escritorio" width="224" height="300" class="aligncenter size-medium wp-image-9" /></a>
id | 9
caption | The image caption
title | escritorio
align | center
url | http://wp34.dev/wp-content/uploads/2012/11/escritorio.jpg
size | medium
alt | Alt text for the image