WordPress.org

Make WordPress Core

Changeset 16865


Ignore:
Timestamp:
12/10/10 19:15:37 (4 years ago)
Author:
nacin
Message:

use_default_gallery_style boolean filter and new gallery-columns-* class. see #15103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r16864 r16865  
    824824    $selector = "gallery-{$instance}"; 
    825825 
    826     $output = apply_filters('gallery_style', " 
     826    $gallery_style = $gallery_div = ''; 
     827    if ( apply_filters( 'use_default_gallery_style', true ) ) 
     828        $gallery_style = " 
    827829        <style type='text/css'> 
    828830            #{$selector} { 
     
    833835                margin-top: 10px; 
    834836                text-align: center; 
    835                 width: {$itemwidth}%;           } 
     837                width: {$itemwidth}%; 
     838            } 
    836839            #{$selector} img { 
    837840                border: 2px solid #cfcfcf; 
     
    841844            } 
    842845        </style> 
    843         <!-- see gallery_shortcode() in wp-includes/media.php --> 
    844         <div id='$selector' class='gallery galleryid-{$id}'>"); 
     846        <!-- see gallery_shortcode() in wp-includes/media.php -->"; 
     847    $size_class = sanitize_html_class( $size ); 
     848    $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; 
     849    $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div ); 
    845850 
    846851    $i = 0; 
Note: See TracChangeset for help on using the changeset viewer.