Changeset 9847 for trunk/wp-includes/media.php
- Timestamp:
- 11/23/2008 06:37:15 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/media.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r9688 r9847 523 523 * @param string $size Optional, default is 'thumbnail'. 524 524 * @param bool $icon Optional, default is false. Whether it is an icon. 525 * @param int $imgwidth Override image width. 525 526 * @return string HTML img element or empty string on failure. 526 527 */ 527 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false ) {528 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $imgwidth = false) { 528 529 529 530 $html = ''; … … 531 532 if ( $image ) { 532 533 list($src, $width, $height) = $image; 533 $hwstring = image_hwstring($width, $height);534 $hwstring = $imgwidth ? image_hwstring($imgwidth, '') : image_hwstring($width, $height); 534 535 if ( is_array($size) ) 535 536 $size = join('x', $size); … … 619 620 'columns' => 3, 620 621 'size' => 'thumbnail', 622 'imgwidth' => '' 621 623 ), $attr)); 622 624 … … 638 640 $columns = intval($columns); 639 641 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 642 $imgwidth = isset($imgwidth) && (int) $imgwidth ? $imgwidth : false; 640 643 641 644 $output = apply_filters('gallery_style', " … … 661 664 $i = 0; 662 665 foreach ( $attachments as $id => $attachment ) { 663 $link = wp_get_attachment_link($id, $size, true); 666 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false, $imgwidth) : wp_get_attachment_link($id, $size, true, false, $imgwidth); 667 664 668 $output .= "<{$itemtag} class='gallery-item'>"; 665 669 $output .= "
Note: See TracChangeset
for help on using the changeset viewer.