WordPress.org

Make WordPress Core

Ticket #27058: media.patch

File media.patch, 1.8 KB (added by nboehr, 6 years ago)

Working patch against revision 28669

  • media.php

     
    900900 *     @type string $exclude    A comma-separated list of IDs of attachments to exclude. Default empty.
    901901 *     @type string $link       What to link each image to. Default empty (links to the attachment page).
    902902 *                              Accepts 'file', 'none'.
     903 *     @type string $limit      The maximum number of images to display. Has no effect, if either ids,
     904 *                              include or empty are specified. To display all images, use -1.
    903905 * }
    904906 * @return string HTML content to display gallery.
    905907 */
     
    955957               'size'       => 'thumbnail',
    956958               'include'    => '',
    957959               'exclude'    => '',
    958                'link'       => ''
     960               'link'       => '',
     961               'limit'      => -1
    959962       ), $attr, 'gallery' );
    960963
    961964       $id = intval( $atts['id'] );
     
    973976       } elseif ( ! empty( $atts['exclude'] ) ) {
    974977               $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
    975978       } else {
    976                $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
     979               $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'], 'posts_per_page' => $atts['limit'] ) );
    977980       }
    978981
    979982       if ( empty( $attachments ) ) {