diff --git wp-includes/media.php wp-includes/media.php
index e0ed8f4..c26103a 100644
|
|
add_shortcode('gallery', 'gallery_shortcode'); |
1386 | 1386 | * @type string $exclude A comma-separated list of IDs of attachments to exclude. Default empty. |
1387 | 1387 | * @type string $link What to link each image to. Default empty (links to the attachment page). |
1388 | 1388 | * Accepts 'file', 'none'. |
| 1389 | * @type string $linksize Size of the images to link to. A string keyword (thumbnail, |
| 1390 | * medium, large, or full) as allowed by wp_get_attachment_image_src(). |
| 1391 | * Default empty. |
1389 | 1392 | * } |
1390 | 1393 | * @return string HTML content to display gallery. |
1391 | 1394 | */ |
… |
… |
function gallery_shortcode( $attr ) { |
1435 | 1438 | 'size' => 'thumbnail', |
1436 | 1439 | 'include' => '', |
1437 | 1440 | 'exclude' => '', |
1438 | | 'link' => '' |
| 1441 | 'link' => '', |
| 1442 | 'linksize' => '' |
1439 | 1443 | ), $attr, 'gallery' ); |
1440 | 1444 | |
1441 | 1445 | $id = intval( $atts['id'] ); |
… |
… |
function gallery_shortcode( $attr ) { |
1536 | 1540 | |
1537 | 1541 | $attr = ( trim( $attachment->post_excerpt ) ) ? array( 'aria-describedby' => "$selector-$id" ) : ''; |
1538 | 1542 | if ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) { |
1539 | | $image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr ); |
| 1543 | if ( ! empty( $atts['linksize'] ) ) { |
| 1544 | $image_src = wp_get_attachment_image_src( $id, $atts['linksize'] ); |
| 1545 | $image_output = "<a href='" . $image_src[0]. "'>" . wp_get_attachment_image( $id, $atts['size'], false ) . '</a>'; |
| 1546 | } else { |
| 1547 | $image_output = wp_get_attachment_link( $id, $atts['size'], false, false ); |
| 1548 | } |
| 1549 | // $image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr ); |
1540 | 1550 | } elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) { |
1541 | 1551 | $image_output = wp_get_attachment_image( $id, $atts['size'], false, $attr ); |
1542 | 1552 | } else { |