WordPress.org

Make WordPress Core

Changeset 27396


Ignore:
Timestamp:
03/04/2014 06:52:34 PM (4 years ago)
Author:
nacin
Message:

Do not output default gallery styles if the theme has opted into HTML5 galleries.

fixes #27045. see #26697.

File:
1 edited

Legend:

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

    r27328 r27396  
    876876
    877877    $gallery_style = $gallery_div = '';
    878     if ( apply_filters( 'use_default_gallery_style', true ) )
     878
     879    /**
     880     * Filter whether to print default gallery styles.
     881     *
     882     * @since 3.1.0
     883     *
     884     * @param bool $print Whether to print default gallery styles.
     885     *                    Defaults to false if the theme supports HTML5 galleries.
     886     *                    Otherwise, defaults to true.
     887     */
     888    if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
    879889        $gallery_style = "
    880890        <style type='text/css'>
     
    895905            }
    896906            /* see gallery_shortcode() in wp-includes/media.php */
    897         </style>";
     907        </style>\n\t\t";
     908    }
     909
    898910    $size_class = sanitize_html_class( $size );
    899911    $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
    900     $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
     912    $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
    901913
    902914    $i = 0;
Note: See TracChangeset for help on using the changeset viewer.