WordPress.org

Make WordPress Core

Ticket #21827: 21827.2.patch

File 21827.2.patch, 1.1 KB (added by SergeyBiryukov, 20 months ago)
  • wp-includes/media.php

     
    817817        } 
    818818 
    819819        if ( !empty($include) ) { 
    820                 $include = preg_replace( '/[^0-9,]+/', '', $include ); 
    821820                $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); 
    822821 
    823822                $attachments = array(); 
     
    825824                        $attachments[$val->ID] = $_attachments[$key]; 
    826825                } 
    827826        } elseif ( !empty($exclude) ) { 
    828                 $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); 
    829827                $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); 
    830828        } else { 
    831829                $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );