Use the attachment metadata to get the size infomation rather than making an HTTP request for the image in the attachment template.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
01389755c7
commit
32b4cbe0da
|
@ -42,13 +42,13 @@
|
||||||
);
|
);
|
||||||
if ( wp_attachment_is_image() ) {
|
if ( wp_attachment_is_image() ) {
|
||||||
echo ' <span class="meta-sep">|</span> ';
|
echo ' <span class="meta-sep">|</span> ';
|
||||||
$size = getimagesize( wp_get_attachment_url() );
|
$metadata = wp_get_attachment_metadata();
|
||||||
printf( __( 'Full size is %s pixels', 'twentyten'),
|
printf( __( 'Full size is %s pixels', 'twentyten'),
|
||||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||||
wp_get_attachment_url(),
|
wp_get_attachment_url(),
|
||||||
esc_attr( __('Link to full-size image', 'twentyten') ),
|
esc_attr( __('Link to full-size image', 'twentyten') ),
|
||||||
$size[0],
|
$metadata['width'],
|
||||||
$size[1]
|
$metadata['height']
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue