From 0144917401d9b813f8b5aa2c9c910261bd861f25 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Fri, 5 Aug 2022 09:58:58 -0600 Subject: [PATCH] Remove unusued function `_wp_make_additional_mime_types` --- src/wp-admin/includes/image.php | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index c28b44ba7beb..53848e4f412c 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -726,39 +726,6 @@ function _wp_make_additional_mime_types( $new_mime_types, $file, $image_meta, $a return $image_meta; } - -/** - * Checks if an image belongs to an attachment. - * - * @since 6.1.0 - * @access private - * - * @param string $filename Full path to the image file. - * @param int $attachment_id Attachment ID to check. - * @return bool True if the image belongs to the attachment, false otherwise. - */ -function _wp_image_belongs_to_attachment( $filename, $attachment_id ) { - $meta_data = wp_get_attachment_metadata( $attachment_id ); - - if ( ! isset( $image_meta['sizes'] ) ) { - return false; - } - $sizes = $image_meta['sizes']; - foreach ( $sizes as $size ) { - if ( $size['file'] === $filename ) { - return true; - } - if ( isset( $size['sources'] ) && is_array( $size['sources'] ) ) { - foreach ( $size['sources'] as $source ) { - if ( $source['file'] === $filename ) { - return true; - } - } - } - } - return false; -} - /** * Generates attachment meta data and create image sub-sizes for images. *