From c08712c7209753e3cefff67495f4a15294f0b941 Mon Sep 17 00:00:00 2001 From: Foxaii Date: Sat, 15 Jun 2013 20:39:23 +0200 Subject: [PATCH] Gallery Shortcode Fix A quick fix for http://core.trac.wordpress.org/ticket/23298 N.B. images now link to the file as default --- lib/cleanup.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cleanup.php b/lib/cleanup.php index b7be018..7f134ed 100644 --- a/lib/cleanup.php +++ b/lib/cleanup.php @@ -277,7 +277,8 @@ function roots_gallery($attr) { 'columns' => 3, 'size' => 'thumbnail', 'include' => '', - 'exclude' => '' + 'exclude' => '', + 'link' => 'file' ), $attr)); $id = intval($id); @@ -315,9 +316,9 @@ function roots_gallery($attr) { $i = 0; foreach ($attachments as $id => $attachment) { - $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); + $image = ('file' == $link) ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); - $output .= '
  • ' . $link; + $output .= '
  • ' . $image; if (trim($attachment->post_excerpt)) { $output .= ''; }