Changeset 34578 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 09/26/2015 05:02:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r34575 r34578 5735 5735 } 5736 5736 5737 if ( !empty($data['overwrite']) && ($data['overwrite'] == true) ) {5738 // Get postmeta info on the object.5739 $old_file = $wpdb->get_row("5740 SELECT ID5741 FROM {$wpdb->posts}5742 WHERE post_title = '{$name}'5743 AND post_type = 'attachment'5744 ");5745 5746 // Delete previous file.5747 wp_delete_attachment($old_file->ID);5748 5749 // Make sure the new name is different by pre-pending the5750 // previous post id.5751 $filename = preg_replace('/^wpid\d+-/', '', $name);5752 $name = "wpid{$old_file->ID}-{$filename}";5753 }5754 5755 5737 $upload = wp_upload_bits($name, null, $bits); 5756 5738 if ( ! empty($upload['error']) ) {
Note: See TracChangeset
for help on using the changeset viewer.