WordPress.org

Make WordPress Core

Ticket #32168: media-421-change.path

File media-421-change.path, 2.3 KB (added by frymi, 6 years ago)

./wp-includes/media.php

Line 
1--- C:/Users/robert/AppData/Local/Temp/media.php-revBASE.svn001.tmp.php so IV 11 23:48:22 2015
2+++ D:/wordpress-svn/src/wp-includes/media.php  út IV 28 18:53:09 2015
3@@ -995,13 +995,17 @@ function gallery_shortcode( $attr ) {
4                'size'       => 'thumbnail',
5                'include'    => '',
6                'exclude'    => '',
7+               'start'      => 1,
8+               'count'      => 99,
9                'link'       => ''
10        ), $attr, 'gallery' );
11 
12        $id = intval( $atts['id'] );
13+       $start = intval($start);
14+       $count = intval($count);
15 
16        if ( ! empty( $atts['include'] ) ) {
17-               $_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
18+               $_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'], 'offset' => $atts['start']-1, 'numberposts' => $atts['count'] ) );
19 
20                $attachments = array();
21                foreach ( $_attachments as $key => $val ) {
22@@ -1008,9 +1012,9 @@ function gallery_shortcode( $attr ) {
23                        $attachments[$val->ID] = $_attachments[$key];
24                }
25        } elseif ( ! empty( $atts['exclude'] ) ) {
26-               $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'] ) );
27+               $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'], 'offset' => $atts['start']-1, 'numberposts' => $atts['count'] ) );
28        } else {
29-               $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
30+               $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'], 'offset' => $atts['start']-1, 'numberposts' => $atts['count'] ) );
31        }