这是wp_get_attachment_image_scr
功能:
function wp_get_attachment_image_src($attachment_id, $size=\'thumbnail\', $icon = false) {
// get a thumbnail or intermediate image if there is one
if ( $image = image_downsize($attachment_id, $size) )
return $image;
$src = false;
if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
/** This filter is documented in wp-includes/post.php */
$icon_dir = apply_filters( \'icon_dir\', ABSPATH . WPINC . \'/images/media\' );
$src_file = $icon_dir . \'/\' . wp_basename($src);
@list($width, $height) = getimagesize($src_file);
}
if ( $src && $width && $height )
return array( $src, $width, $height );
return false;
}
正如你所看到的,如果3-rd参数为true,那么它会在icons dir中查找该图像(我假设
wp_mime_type_icon
退货
default.png
还有一些插件
add_filter
到
icon_dir
未来
wp-includes/images/crystal
只需删除示例中的第三个参数:$thumb_url_array = wp_get_attachment_image_src($thumb_id,\'full\');
它应该会回来false
如果没有图像或图像url