Media: remove unused _wp_image_belongs_to_attachment function.

Remove the `_wp_image_belongs_to_attachment` function which was left over from a an unused branch and added inadvertently as part of r53751.

Props mukesh27.
Fixes #56333.


Built from https://develop.svn.wordpress.org/trunk@53845


git-svn-id: http://core.svn.wordpress.org/trunk@53404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2022-08-05 16:12:13 +00:00
parent efbd56d13b
commit c1862616c2
2 changed files with 1 additions and 34 deletions

View File

@ -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.
*

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53844';
$wp_version = '6.1-alpha-53845';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.