Save parent temp ID for unattached attachments in postmeta. Props scribu. fixes #9471

git-svn-id: http://svn.automattic.com/wordpress/trunk@12298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2009-11-30 21:41:52 +00:00
parent 8f3af1eb02
commit 97bf1f11bd
2 changed files with 14 additions and 1 deletions

View File

@@ -2804,6 +2804,9 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
clean_post_cache($post_ID);
if ( isset($post_parent) && $post_parent < 0 )
add_post_meta($post_ID, '_wp_attachment_temp_parent', $post_parent, true);
if ( $update) {
do_action('edit_attachment', $post_ID);
} else {