Fixed minor bug in gallery shortcode
This commit is contained in:
@@ -274,17 +274,9 @@ function roots_gallery_shortcode($attr) {
|
|||||||
foreach ( $attachments as $id => $attachment ) {
|
foreach ( $attachments as $id => $attachment ) {
|
||||||
// make the gallery link to the file by default instead of the attachment
|
// make the gallery link to the file by default instead of the attachment
|
||||||
// thanks to Matt Price (countingrows.com)
|
// thanks to Matt Price (countingrows.com)
|
||||||
switch($attr['link']) {
|
$link = isset($attr['link']) && $attr['link'] === 'attachment' ?
|
||||||
case 'file':
|
wp_get_attachment_link($id, $size, true, false) :
|
||||||
$link = wp_get_attachment_link($id, $size, false, false);
|
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;
|
|
||||||
}
|
|
||||||
$output .= "
|
$output .= "
|
||||||
<{$icontag} class=\"gallery-item\">
|
<{$icontag} class=\"gallery-item\">
|
||||||
$link
|
$link
|
||||||
|
|||||||
Reference in New Issue
Block a user