Changeset 56143 for trunk/src/wp-includes/media.php
- Timestamp:
- 07/05/2023 09:36:23 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r56142 r56143 5589 5589 return $loading_attributes; 5590 5590 }; 5591 // Closure to increase media count for images with certain minimum threshold, mostly used for header images. 5592 $maybe_increase_content_media_count = static function() use ( $attr ) { 5593 /** This filter is documented in wp-admin/includes/media.php */ 5594 $wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 ); 5595 // Images with a certain minimum size in the header of the page are also counted towards the threshold. 5596 if ( $wp_min_priority_img_pixels <= $attr['width'] * $attr['height'] ) { 5597 wp_increase_content_media_count(); 5598 } 5599 }; 5591 5600 5592 5601 $loading_attrs = array(); … … 5641 5650 $header_area = WP_TEMPLATE_PART_AREA_HEADER; 5642 5651 if ( "template_part_{$header_area}" === $context ) { 5652 // Increase media count if there are images in header above a certian minimum size threshold. 5653 $maybe_increase_content_media_count(); 5643 5654 return $postprocess( $loading_attrs, true ); 5644 5655 } … … 5646 5657 // The custom header image is always expected to be in the header. 5647 5658 if ( 'get_header_image_tag' === $context ) { 5659 // Increase media count if there are images in header above a certian minimum size threshold. 5660 $maybe_increase_content_media_count(); 5648 5661 return $postprocess( $loading_attrs, true ); 5649 5662 } … … 5672 5685 && did_action( 'get_header' ) && ! did_action( 'get_footer' ) 5673 5686 ) { 5687 // Increase media count if there are images in header above a certian minimum size threshold. 5688 $maybe_increase_content_media_count(); 5674 5689 return $postprocess( $loading_attrs, true ); 5675 5690 }
Note: See TracChangeset
for help on using the changeset viewer.