Media: Pass the attachment ID to the wp_image_file_matches_image_meta filter.

Props spacedmonkey.
Fixes #50722.

git-svn-id: https://develop.svn.wordpress.org/trunk@48547 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-21 16:52:48 +00:00
parent 11fe34deb8
commit ffef4daf88
2 changed files with 15 additions and 12 deletions
@@ -424,7 +424,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
if (
! $image_meta ||
! $image_file ||
! wp_image_file_matches_image_meta( $request['src'], $image_meta )
! wp_image_file_matches_image_meta( $request['src'], $image_meta, $attachment_id )
) {
return new WP_Error(
'rest_unknown_attachment',