WordPress.org

Make WordPress Core

Ticket #6772: 6772.diff

File 6772.diff, 569 bytes (added by DD32, 6 years ago)

converted function to use array format for passing at the same time

  • wp-includes/media.php

     
    359359        ), $attr)); 
    360360 
    361361        $id = intval($id); 
    362         $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}"); 
     362        $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => $orderby) ); 
    363363 
    364364        if ( empty($attachments) ) 
    365365                return '';