Changeset 9894 for trunk/wp-includes/media.php
- Timestamp:
- 11/26/2008 02:27:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r9847 r9894 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.526 525 * @return string HTML img element or empty string on failure. 527 526 */ 528 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false , $imgwidth = false) {527 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false) { 529 528 530 529 $html = ''; … … 532 531 if ( $image ) { 533 532 list($src, $width, $height) = $image; 534 $hwstring = $imgwidth ? image_hwstring($imgwidth, '') :image_hwstring($width, $height);533 $hwstring = image_hwstring($width, $height); 535 534 if ( is_array($size) ) 536 535 $size = join('x', $size); … … 619 618 'captiontag' => 'dd', 620 619 'columns' => 3, 621 'size' => 'thumbnail', 622 'imgwidth' => '' 620 'size' => 'thumbnail' 623 621 ), $attr)); 624 622 … … 640 638 $columns = intval($columns); 641 639 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 642 $imgwidth = isset($imgwidth) && (int) $imgwidth ? $imgwidth : false;643 640 644 641 $output = apply_filters('gallery_style', " … … 664 661 $i = 0; 665 662 foreach ( $attachments as $id => $attachment ) { 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);663 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 667 664 668 665 $output .= "<{$itemtag} class='gallery-item'>";
Note: See TracChangeset
for help on using the changeset viewer.