mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Attachment data abstraction from mdawaffe. fixes #3440
git-svn-id: https://develop.svn.wordpress.org/trunk@4612 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user