summaryrefslogtreecommitdiffstats
path: root/wp-admin/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/post.php')
-rw-r--r--wp-admin/post.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/wp-admin/post.php b/wp-admin/post.php
index 31d16bd..b35ff33 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -78,13 +78,10 @@ case 'editattachment':
$_POST['post_type'] = 'attachment';
// Update the thumbnail filename
- $oldmeta = $newmeta = get_post_meta($post_id, '_wp_attachment_metadata', true);
+ $newmeta = wp_get_attachment_metadata( $post_id, true );
$newmeta['thumb'] = $_POST['thumb'];
- if ( '' !== $oldmeta )
- update_post_meta($post_id, '_wp_attachment_metadata', $newmeta, $oldmeta);
- else
- add_post_meta($post_id, '_wp_attachment_metadata', $newmeta);
+ wp_update_attachment_metadata( $post_id, $newmeta );
case 'editpost':
$post_ID = (int) $_POST['post_ID'];