From f0b330e994a462f3aff549200dfd4b8bfdbde0b4 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 4 Mar 2014 18:52:34 +0000 Subject: [PATCH] Do not output default gallery styles if the theme has opted into HTML5 galleries. fixes #27045. see #26697. git-svn-id: https://develop.svn.wordpress.org/trunk@27396 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 41a85a8532..ee3debf10d 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -875,7 +875,17 @@ function gallery_shortcode( $attr ) { $selector = "gallery-{$instance}"; $gallery_style = $gallery_div = ''; - if ( apply_filters( 'use_default_gallery_style', true ) ) + + /** + * Filter whether to print default gallery styles. + * + * @since 3.1.0 + * + * @param bool $print Whether to print default gallery styles. + * Defaults to false if the theme supports HTML5 galleries. + * Otherwise, defaults to true. + */ + if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) { $gallery_style = " "; + \n\t\t"; + } + $size_class = sanitize_html_class( $size ); $gallery_div = "