Make WordPress Core


Ignore:
Timestamp:
10/19/2017 04:17:31 AM (8 years ago)
Author:
joemcgill
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r41887 r41937  
    12151215        $header_images[$header_index]['thumbnail_url'] = $url;
    12161216        $header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
    1217         $header_images[$header_index]['attachment_parent'] = (int) get_post_meta( $header->ID, '_wp_attachment_parent', true );
     1217        $header_images[$header_index]['attachment_parent'] = isset( $header_data['attachment_parent'] ) ? $header_data['attachment_parent'] : '';
    12181218
    12191219        if ( isset( $header_data['width'] ) )
Note: See TracChangeset for help on using the changeset viewer.