WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/14/2008 11:01:16 PM (13 years ago)
Author:
ryan
Message:

Notice fixes from DD32. see #7509

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r9676 r9699  
    210210
    211211    // Save the data
    212     $id = wp_insert_attachment($attachment, $file, $post_parent);
     212    $id = wp_insert_attachment($attachment, $file, $post_id);
    213213    if ( !is_wp_error($id) ) {
    214214        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
     
    990990    }
    991991
    992     if ( empty($attachments) )
    993         return '';
    994 
    995     foreach ( $attachments as $id => $attachment )
     992    $output = '';
     993    foreach ( (array) $attachments as $id => $attachment )
    996994        if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
    997995            $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>";
     
    10401038    }
    10411039
     1040    $type = '';
    10421041    if ( isset($post_mime_types) ) {
    10431042        $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
Note: See TracChangeset for help on using the changeset viewer.