Merge pull request #787 from Foxaii/gallery_shortcode_fix
Gallery Shortcode Fix
This commit is contained in:
@@ -277,7 +277,8 @@ function roots_gallery($attr) {
|
|||||||
'columns' => 3,
|
'columns' => 3,
|
||||||
'size' => 'thumbnail',
|
'size' => 'thumbnail',
|
||||||
'include' => '',
|
'include' => '',
|
||||||
'exclude' => ''
|
'exclude' => '',
|
||||||
|
'link' => 'file'
|
||||||
), $attr));
|
), $attr));
|
||||||
|
|
||||||
$id = intval($id);
|
$id = intval($id);
|
||||||
@@ -315,9 +316,9 @@ function roots_gallery($attr) {
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($attachments as $id => $attachment) {
|
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 .= '<li>' . $link;
|
$output .= '<li>' . $image;
|
||||||
if (trim($attachment->post_excerpt)) {
|
if (trim($attachment->post_excerpt)) {
|
||||||
$output .= '<div class="caption hidden">' . wptexturize($attachment->post_excerpt) . '</div>';
|
$output .= '<div class="caption hidden">' . wptexturize($attachment->post_excerpt) . '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user