diff --git a/wp-includes/media.php b/wp-includes/media.php index f30b7e14fc..ab33c88c04 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -367,7 +367,7 @@ function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) { * @param string $title Image description for the title attribute. * @param string $align Part of the class name for aligning the image. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of - * width and height values in pixels (in that order). Default 'medium'. + * width and height values in pixels (in that order). Default 'medium'. * @return string HTML IMG element for given image attachment */ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { @@ -377,7 +377,8 @@ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { $title = $title ? 'title="' . esc_attr( $title ) . '" ' : ''; - $class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size ) . ' wp-image-' . $id; + $size_class = is_array( $size ) ? implode( 'x', $size ) : $size; + $class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size_class ) . ' wp-image-' . $id; /** * Filters the value of the attachment's image tag class attribute. @@ -2334,7 +2335,7 @@ function gallery_shortcode( $attr ) { \n\t\t"; } - $size_class = sanitize_html_class( $atts['size'] ); + $size_class = sanitize_html_class( is_array( $atts['size'] ) ? implode( 'x', $atts['size'] ) : $atts['size'] ); $gallery_div = "