From 978e394248b43faed0765140e8fce3e737661c6b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 4 Mar 2014 18:53:13 +0000 Subject: [PATCH] Do not output default gallery styles if the theme has opted into HTML5 galleries. fixes #27045. see #26697. Built from https://develop.svn.wordpress.org/trunk@27396 git-svn-id: http://core.svn.wordpress.org/trunk@27244 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 41a85a8532..ee3debf10d 100644 --- a/wp-includes/media.php +++ b/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 = "