mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Customizer: Minimize duplicate header crops in the media library.
This adds `Custom_Image_Header::get_previous_crop()`, which finds any previously cropped headers created from the same base image and replaces that attachment rather than creating a new attachment. After updating a crop, the replaced images is also removed from the list of previous header images in the Customizer. See #21819. git-svn-id: https://develop.svn.wordpress.org/trunk@41732 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1214,6 +1214,7 @@ function get_uploaded_header_images() {
|
||||
$header_images[$header_index]['url'] = $url;
|
||||
$header_images[$header_index]['thumbnail_url'] = $url;
|
||||
$header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
|
||||
$header_images[$header_index]['attachment_parent'] = (int) get_post_meta( $header->ID, '_wp_attachment_parent', true );
|
||||
|
||||
if ( isset( $header_data['width'] ) )
|
||||
$header_images[$header_index]['width'] = $header_data['width'];
|
||||
|
||||
Reference in New Issue
Block a user