mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Save parent temp ID for unattached attachments in postmeta. Props scribu. fixes #9471
git-svn-id: https://develop.svn.wordpress.org/trunk@12298 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user