WordPress.org

Make WordPress Core

Ticket #21827: 21827.patch

File 21827.patch, 1.2 KB (added by SergeyBiryukov, 3 years ago)
  • wp-includes/media.php

     
    817817        } 
    818818 
    819819        if ( !empty($include) ) { 
    820                 $include = preg_replace( '/[^0-9,]+/', '', $include ); 
     820                $include = wp_parse_id_list( $include ); 
    821821                $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); 
    822822 
    823823                $attachments = array(); 
     
    825825                        $attachments[$val->ID] = $_attachments[$key]; 
    826826                } 
    827827        } elseif ( !empty($exclude) ) { 
    828                 $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); 
     828                $exclude = wp_parse_id_list( $exclude ); 
    829829                $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); 
    830830        } else { 
    831831                $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );