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: https://develop.svn.wordpress.org/trunk@14700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a0740155c5
commit
fec613607a
|
@ -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