Ticket #20786: 20786.diff
| File 20786.diff, 859 bytes (added by mdawaffe, 12 months ago) |
|---|
-
wp-admin/upload.php
69 69 continue; 70 70 71 71 $attach[] = $att_id; 72 clean_attachment_cache( $att_id );73 72 } 74 73 75 74 if ( ! empty( $attach ) ) { 76 $attach = implode( ',', $attach ); 77 $attached = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $attach )", $parent_id ) ); 75 $attach_string = implode( ',', $attach ); 76 $attached = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $attach_string )", $parent_id ) ); 77 foreach ( $attach as $att_id ) { 78 clean_attachment_cache( $att_id ); 79 } 78 80 } 79 81 80 82 if ( isset( $attached ) ) {
