mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 11:44:33 +00:00
Customizer: Improve handling of crops in the media library.
This is a follow up on r41732, implementing the following improvements: * Attachment parent info is now stored in attachment meta rather than a separate post meta key. * Attachments created from contextual crops (e.g. header, logos, etc.) are filtered out of the media library using a new `_filterContext` method in `wp.media.controller.Library`. Props joemcgill, westonruter. See #21819. git-svn-id: https://develop.svn.wordpress.org/trunk@41937 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1214,7 +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 );
|
||||
$header_images[$header_index]['attachment_parent'] = isset( $header_data['attachment_parent'] ) ? $header_data['attachment_parent'] : '';
|
||||
|
||||
if ( isset( $header_data['width'] ) )
|
||||
$header_images[$header_index]['width'] = $header_data['width'];
|
||||
|
||||
Reference in New Issue
Block a user