WordPress.org

Make WordPress Core

Ticket #11725: 11725.3.diff

File 11725.3.diff, 2.3 KB (added by aaroncampbell, 7 years ago)
  • wp-includes/media.php

     
    783783                'columns'    => 3,
    784784                'size'       => 'thumbnail',
    785785                'include'    => '',
    786                 'exclude'    => ''
     786                'exclude'    => '',
     787                'start'      => 1,
     788                'count'      => -1,
    787789        ), $attr));
    788790
    789791        $id = intval($id);
     
    792794
    793795        if ( !empty($include) ) {
    794796                $include = preg_replace( '/[^0-9,]+/', '', $include );
    795                 $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     797                $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) );
    796798
    797799                $attachments = array();
    798800                foreach ( $_attachments as $key => $val ) {
     
    800802                }
    801803        } elseif ( !empty($exclude) ) {
    802804                $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
    803                 $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     805                $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) );
    804806        } else {
    805                 $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     807                $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) );
    806808        }
    807809
    808810        if ( empty($attachments) )
     
    13981400        require_once( ABSPATH . WPINC . '/class-oembed.php' );
    13991401        $oembed = _wp_oembed_get_object();
    14001402        $oembed->providers[$format] = array( $provider, $regex );
    1401 }
    1402  No newline at end of file
     1403}