If `IMAGE_EDIT_OVERWRITE` is defined as `true`, ensure that multiple edits to the same image does not result in the file being deleted (updating the meta fails because the old and new paths are identical).
Props hew. Fixes #30394. Built from https://develop.svn.wordpress.org/trunk@31043 git-svn-id: http://core.svn.wordpress.org/trunk@31024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f79eb196df
commit
a9302b2e36
|
@ -748,7 +748,7 @@ function wp_save_image( $post_id ) {
|
||||||
if ( $tag )
|
if ( $tag )
|
||||||
$backup_sizes[$tag] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $path_parts['basename']);
|
$backup_sizes[$tag] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $path_parts['basename']);
|
||||||
|
|
||||||
$success = update_attached_file( $post_id, $new_path );
|
$success = ( $path === $new_path ) || update_attached_file( $post_id, $new_path );
|
||||||
|
|
||||||
$meta['file'] = _wp_relative_upload_path( $new_path );
|
$meta['file'] = _wp_relative_upload_path( $new_path );
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31042';
|
$wp_version = '4.2-alpha-31043';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue