mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Make the file names unique for cropped header images. Props SergeyBiryukov. fixes #20666
git-svn-id: https://develop.svn.wordpress.org/trunk@20787 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c6e002e4b0
commit
cdc9ebd779
@ -93,6 +93,8 @@ function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $s
|
||||
// using a replication plugin.
|
||||
wp_mkdir_p( dirname( $dst_file ) );
|
||||
|
||||
$dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
|
||||
|
||||
if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) )
|
||||
return $dst_file;
|
||||
elseif ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user