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 = "