Make WordPress Core

Ticket #29379: 29379.patch

File 29379.patch, 993 bytes (added by shailu25, 5 months ago)

Refreshed Patch.

  • src/wp-includes/media.php

    diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
    index b360c6dd34..60f45b7d25 100644
    a b function gallery_shortcode( $attr ) { 
    27342734                </style>\n\t\t";
    27352735        }
    27362736
    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>";
    27392753
    27402754        /**
    27412755         * Filters the default gallery shortcode CSS styles.