Changeset 11339
- Timestamp:
- 05/15/2009 08:52:04 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r11336 r11339 611 611 function gallery_shortcode($attr) { 612 612 global $post; 613 614 static $instance = 0; 615 $instance++; 613 616 614 617 // Allow plugins/themes to override the default gallery template. … … 643 646 if ( is_feed() ) { 644 647 $output = "\n"; 645 foreach ( $attachments as $ id => $attachment )646 $output .= wp_get_attachment_link($ id, $size, true) . "\n";648 foreach ( $attachments as $att_id => $attachment ) 649 $output .= wp_get_attachment_link($att_id, $size, true) . "\n"; 647 650 return $output; 648 651 } … … 652 655 $columns = intval($columns); 653 656 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 657 658 $selector = "gallery-{$instance}"; 654 659 655 660 $output = apply_filters('gallery_style', " 656 661 <style type='text/css'> 657 .gallery{662 #{$selector} { 658 663 margin: auto; 659 664 } 660 .gallery-item {665 #{$selector} .gallery-item { 661 666 float: left; 662 667 margin-top: 10px; 663 668 text-align: center; 664 669 width: {$itemwidth}%; } 665 .galleryimg {670 #{$selector} img { 666 671 border: 2px solid #cfcfcf; 667 672 } 668 .gallery-caption {673 #{$selector} .gallery-caption { 669 674 margin-left: 0; 670 675 } 671 676 </style> 672 677 <!-- see gallery_shortcode() in wp-includes/media.php --> 673 <div class='gallery'>");678 <div id='$selector' class='gallery galleryid-{$id}'>"); 674 679 675 680 $i = 0;
Note: See TracChangeset
for help on using the changeset viewer.