Allow to filter the link
attribute via shortcode_atts_gallery
. props iworks. fixes #24979.
git-svn-id: https://develop.svn.wordpress.org/trunk@25665 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0a13564db8
commit
27fe045132
@ -733,7 +733,8 @@ function gallery_shortcode($attr) {
|
|||||||
'columns' => 3,
|
'columns' => 3,
|
||||||
'size' => 'thumbnail',
|
'size' => 'thumbnail',
|
||||||
'include' => '',
|
'include' => '',
|
||||||
'exclude' => ''
|
'exclude' => '',
|
||||||
|
'link' => ''
|
||||||
), $attr, 'gallery'));
|
), $attr, 'gallery'));
|
||||||
|
|
||||||
$id = intval($id);
|
$id = intval($id);
|
||||||
@ -807,9 +808,9 @@ function gallery_shortcode($attr) {
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ( $attachments as $id => $attachment ) {
|
foreach ( $attachments as $id => $attachment ) {
|
||||||
if ( ! empty( $attr['link'] ) && 'file' === $attr['link'] )
|
if ( ! empty( $link ) && 'file' === $link )
|
||||||
$image_output = wp_get_attachment_link( $id, $size, false, false );
|
$image_output = wp_get_attachment_link( $id, $size, false, false );
|
||||||
elseif ( ! empty( $attr['link'] ) && 'none' === $attr['link'] )
|
elseif ( ! empty( $link ) && 'none' === $link )
|
||||||
$image_output = wp_get_attachment_image( $id, $size, false );
|
$image_output = wp_get_attachment_image( $id, $size, false );
|
||||||
else
|
else
|
||||||
$image_output = wp_get_attachment_link( $id, $size, true, false );
|
$image_output = wp_get_attachment_link( $id, $size, true, false );
|
||||||
|
Loading…
Reference in New Issue
Block a user