Make WordPress Core

Ticket #7678: 7678.diff

File 7678.diff, 1006 bytes (added by jamescollins, 17 years ago)

patch against r11091

  • wp-includes/media.php

     
    651651        $captiontag = tag_escape($captiontag);
    652652        $columns = intval($columns);
    653653        $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
     654       
     655        $class = "galleryid-{$id}";
    654656
    655657        $output = apply_filters('gallery_style', "
    656658                <style type='text/css'>
    657                         .gallery {
     659                        .{$class} {
    658660                                margin: auto;
    659661                        }
    660                         .gallery-item {
     662                        .{$class} .gallery-item {
    661663                                float: left;
    662664                                margin-top: 10px;
    663665                                text-align: center;
    664666                                width: {$itemwidth}%;                   }
    665                         .gallery img {
     667                        .{$class} img {
    666668                                border: 2px solid #cfcfcf;
    667669                        }
    668                         .gallery-caption {
     670                        .{$class} .gallery-caption {
    669671                                margin-left: 0;
    670672                        }
    671673                </style>
    672674                <!-- see gallery_shortcode() in wp-includes/media.php -->
    673                 <div class='gallery'>");
     675                <div class='gallery $class'>");
    674676
    675677        $i = 0;
    676678        foreach ( $attachments as $id => $attachment ) {