Changeset 4612 for trunk/wp-admin/upload-functions.php
- Timestamp:
- 12/05/2006 10:37:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-functions.php
r4466 r4612 3 3 global $post; 4 4 $id = get_the_ID(); 5 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true);5 $attachment_data = wp_get_attachment_metadata( $id ); 6 6 if ( isset($attachment_data['width']) ) 7 7 list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128); … … 58 58 global $style, $post_id, $style; 59 59 $id = get_the_ID(); 60 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true);60 $attachment_data = wp_get_attachment_metadata( $id ); 61 61 ?> 62 62 <div id="upload-file"> … … 99 99 if ( $id ) : 100 100 $attachment = get_post_to_edit( $id ); 101 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true);101 $attachment_data = wp_get_attachment_metadata( $id ); 102 102 ?> 103 103 <div id="file-title"> … … 230 230 $imagedata['file'] = $file; 231 231 232 add_post_meta($id, '_wp_attachment_metadata', $imagedata);232 wp_update_attachment_metadata( $id, $imagedata ); 233 233 234 234 if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) { … … 241 241 $newdata = $imagedata; 242 242 $newdata['thumb'] = basename($thumb); 243 update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);243 wp_update_attachment_metadata( $id, $newdata ); 244 244 } else { 245 245 $error = $thumb; … … 247 247 } 248 248 } else { 249 add_post_meta($id, '_wp_attachment_metadata', array());249 wp_update_attachment_metadata( $id, array() ); 250 250 } 251 251
Note: See TracChangeset
for help on using the changeset viewer.