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