Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unusued function _wp_make_additional_mime_types #3070

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 0 additions & 33 deletions src/wp-admin/includes/image.php
Expand Up @@ -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.
*
Expand Down