Changeset 9699 for trunk/wp-admin/includes/media.php
- Timestamp:
- 11/14/2008 11:01:16 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r9676 r9699 210 210 211 211 // Save the data 212 $id = wp_insert_attachment($attachment, $file, $post_ parent);212 $id = wp_insert_attachment($attachment, $file, $post_id); 213 213 if ( !is_wp_error($id) ) { 214 214 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); … … 990 990 } 991 991 992 if ( empty($attachments) ) 993 return ''; 994 995 foreach ( $attachments as $id => $attachment ) 992 $output = ''; 993 foreach ( (array) $attachments as $id => $attachment ) 996 994 if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) 997 995 $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>"; … … 1040 1038 } 1041 1039 1040 $type = ''; 1042 1041 if ( isset($post_mime_types) ) { 1043 1042 $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.