Allow to filter the `link` attribute via `shortcode_atts_gallery`. props iworks. fixes #24979.
Built from https://develop.svn.wordpress.org/trunk@25665 git-svn-id: http://core.svn.wordpress.org/trunk@25581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fe03c1170a
commit
51ff617278
|
@ -733,7 +733,8 @@ function gallery_shortcode($attr) {
|
|||
'columns' => 3,
|
||||
'size' => 'thumbnail',
|
||||
'include' => '',
|
||||
'exclude' => ''
|
||||
'exclude' => '',
|
||||
'link' => ''
|
||||
), $attr, 'gallery'));
|
||||
|
||||
$id = intval($id);
|
||||
|
@ -807,9 +808,9 @@ function gallery_shortcode($attr) {
|
|||
|
||||
$i = 0;
|
||||
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 );
|
||||
elseif ( ! empty( $attr['link'] ) && 'none' === $attr['link'] )
|
||||
elseif ( ! empty( $link ) && 'none' === $link )
|
||||
$image_output = wp_get_attachment_image( $id, $size, false );
|
||||
else
|
||||
$image_output = wp_get_attachment_link( $id, $size, true, false );
|
||||
|
|
Loading…
Reference in New Issue