From 9d99a42e1e7fcfb07f477109104747e5a4f7a8b9 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Mon, 2 May 2011 18:27:36 -0600 Subject: [PATCH] Fixed minor bug in gallery shortcode --- includes/roots-cleanup.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/includes/roots-cleanup.php b/includes/roots-cleanup.php index 96336ab..1c1eb12 100644 --- a/includes/roots-cleanup.php +++ b/includes/roots-cleanup.php @@ -274,17 +274,9 @@ function roots_gallery_shortcode($attr) { foreach ( $attachments as $id => $attachment ) { // make the gallery link to the file by default instead of the attachment // thanks to Matt Price (countingrows.com) - switch($attr['link']) { - case 'file': - $link = wp_get_attachment_link($id, $size, false, false); - break; - case 'attachment': - $link = wp_get_attachment_link($id, $size, true, false); - break; - default: - $link = wp_get_attachment_link($id, $size, false, false); - break; - } + $link = isset($attr['link']) && $attr['link'] === 'attachment' ? + wp_get_attachment_link($id, $size, true, false) : + wp_get_attachment_link($id, $size, false, false); $output .= " <{$icontag} class=\"gallery-item\"> $link