Make WordPress Core

Ticket #6657: empty-gallery-tab-fix-r7638.patch

File empty-gallery-tab-fix-r7638.patch, 638 bytes (added by tellyworth, 17 years ago)
  • wp-admin/includes/media.php

     
    590590}
    591591
    592592function get_media_items( $post_id, $errors ) {
    593         if ( $post_id && $post = get_post($post_id) ) {
    594                 if ( $post->post_type == 'attachment' )
     593        if ( $post_id ) {
     594                $post = get_post($post_id);
     595                if ( $post && $post->post_type == 'attachment' )
    595596                        $attachments = array($post->ID => $post);
    596597                else
    597598                        $attachments = get_children("post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC");