diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index b360c6dd34..60f45b7d25 100644
a
|
b
|
function gallery_shortcode( $attr ) { |
2734 | 2734 | </style>\n\t\t"; |
2735 | 2735 | } |
2736 | 2736 | |
2737 | | $size_class = sanitize_html_class( is_array( $atts['size'] ) ? implode( 'x', $atts['size'] ) : $atts['size'] ); |
2738 | | $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; |
| 2737 | $classes_str = null; |
| 2738 | $classes = array( |
| 2739 | 'gallery', |
| 2740 | 'galleryid-'.$id, |
| 2741 | 'gallery-columns-'.$columns, |
| 2742 | 'gallery-size-'.sanitize_html_class( $atts['size'] ) |
| 2743 | ); |
| 2744 | |
| 2745 | $classes = apply_filters( 'gallery_classes', $classes, $attr ); |
| 2746 | |
| 2747 | if ( !empty( $classes ) ) { |
| 2748 | $classes = array_filter( $classes ); |
| 2749 | $classes_str = " class='" . implode( ' ', $classes ) . "'"; |
| 2750 | } |
| 2751 | |
| 2752 | $gallery_div = "<div id='$selector' $classes_str>"; |
2739 | 2753 | |
2740 | 2754 | /** |
2741 | 2755 | * Filters the default gallery shortcode CSS styles. |